From b9536ea35fbcd3fa380da7efd540c1a68e12a0a6 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 28 Sep 2023 21:11:03 +0900 Subject: [PATCH] vm.c: use smaller MRB_CALL_LEVEL_MAX with address sanitizer; fix #6068 Since ASAN uses lower memory bound. The other ideas to address #6068 might follow, e.g. removing `args=` from Enumerator. --- src/vm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vm.c b/src/vm.c index e704f9a9d..da6922320 100644 --- a/src/vm.c +++ b/src/vm.c @@ -42,8 +42,12 @@ void abort(void); /* Maximum recursive depth. Should be set lower on memory constrained systems. */ #ifndef MRB_CALL_LEVEL_MAX +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +#define MRB_CALL_LEVEL_MAX 128 +#else #define MRB_CALL_LEVEL_MAX 512 #endif +#endif /* Maximum stack depth. Should be set lower on memory constrained systems. The value below allows about 60000 recursive calls in the simplest case. */