-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ffi/pointer_arithmetic_operators_test is failing on vm-asan-linux-release-x64 #54397
Comments
void main() {
Pointer<Int32> p = calloc<Int32>(3);
p.value = 1;
(p + 1).value = 2;
(p + 2).value = 3;
Expect.equals(1, p.value);
p += 2;
Expect.equals(3, p.value);
p -= 1;
Expect.equals(2, p.value);
calloc.free(p); // <-- missing
} |
We cannot free a pointer after we have changed its address (by doing p+=2 and then p-=1). This code would give an error. |
Ah, yes! We need to save the original |
Oh right. I didn't think of that while writing the test, my bad. I will upload a patch soon! |
Thanks @shikharish ! You can add the following to the bottom of the commit message to ensure that the ASAN bots run before we land the patch:
|
Patch uploaded: https://dart-review.googlesource.com/c/sdk/+/342460 |
https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/vm-asan-linux-release-x64/335/overview
@dcharkes
The text was updated successfully, but these errors were encountered: