From 81dc3f6f6e7b8efec59a7498dd7794417c66f7b1 Mon Sep 17 00:00:00 2001 From: Shikhar Soni Date: Mon, 18 Dec 2023 18:38:05 +0000 Subject: [PATCH] [tests/ffi]: Fix failing pointer arithmetic test. Closes #54397. R=dacoharkes@google.com Cq-Include-Trybots: luci.dart.try:vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try Change-Id: I4ae2cbc7f4eee1bfcd6d608dbc0d838da703c7e0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342460 Reviewed-by: Daco Harkes Reviewed-by: Derek Xu Auto-Submit: Shikhar --- tests/ffi/pointer_arithmetic_operators_test.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ffi/pointer_arithmetic_operators_test.dart b/tests/ffi/pointer_arithmetic_operators_test.dart index 0ae11b2a2e3..ba7f372ac14 100644 --- a/tests/ffi/pointer_arithmetic_operators_test.dart +++ b/tests/ffi/pointer_arithmetic_operators_test.dart @@ -9,6 +9,7 @@ import 'package:ffi/ffi.dart'; void main() { Pointer p = calloc(3); + final p1 = p; p.value = 1; (p + 1).value = 2; (p + 2).value = 3; @@ -17,4 +18,5 @@ void main() { Expect.equals(3, p.value); p -= 1; Expect.equals(2, p.value); + calloc.free(p1); }