[test] Disable detect_stack_use_after_return in sanitizer leak test.

TEST=asan
Bug: https://github.com/dart-lang/sdk/issues/62095
Change-Id: I2556dbbd9101bd83ac00c261f1659e552130b143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465805
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2025-12-03 13:55:41 -08:00
committed by Commit Queue
parent c847a7bf43
commit ebfddebc74
2 changed files with 41 additions and 0 deletions
@@ -0,0 +1,36 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Environment=ASAN_OPTIONS=detect_stack_use_after_return=0
// ASAN's detect_stack_use_after_return (default on) has cost O(stack size) per
// longjmp/noreturn function.
@pragma("vm:never-inline")
foo(n) {
try {
throw 'a';
} catch (e) {}
if (n > 0) {
// Function.apply is implemented as a native, so this introduces new entry
// frames, checking that DartEntryScope saves things as needed.
Function.apply(() => foo(n - 1), []);
Function.apply(() => bar(n - 1), []);
}
try {
throw 'a';
} catch (e) {}
}
// Stagger stack depth.
@pragma("vm:never-inline")
bar(n) {
foo(0);
foo(n);
foo(0);
}
main() {
foo(10);
}
@@ -2,6 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Environment=ASAN_OPTIONS=detect_stack_use_after_return=0
// ASAN's detect_stack_use_after_return (default on) has cost O(stack size) per
// longjmp/noreturn function.
main() {
for (int i = 0; i < 1000000; ++i) {
try {