From 85d0f0d45bf1529db8965b8176f8021d1ca27534 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 13 Mar 2019 14:46:53 -0400 Subject: fix @setRuntimeSafety not able to override release modes --- src/codegen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 22f3b5be09..9f7bef52cb 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -878,9 +878,6 @@ static bool ir_want_fast_math(CodeGen *g, IrInstruction *instruction) { } static bool ir_want_runtime_safety(CodeGen *g, IrInstruction *instruction) { - if (g->build_mode == BuildModeFastRelease || g->build_mode == BuildModeSmallRelease) - return false; - // TODO memoize Scope *scope = instruction->scope; while (scope) { @@ -895,7 +892,9 @@ static bool ir_want_runtime_safety(CodeGen *g, IrInstruction *instruction) { } scope = scope->parent; } - return true; + + return (g->build_mode != BuildModeFastRelease && + g->build_mode != BuildModeSmallRelease); } static Buf *panic_msg_buf(PanicMsgId msg_id) { -- cgit v1.2.3