From f3fa545b978a6d5d29d0bcdc78aca03518183bdc Mon Sep 17 00:00:00 2001 From: Gabriel Smith Date: Sun, 12 Aug 2018 15:23:49 -0400 Subject: Change the sentinel value for __pre_init to something other than 1 The sentinel value of 0, while nice, was being optimized out as the compiler assumed that the function pointer would never be 0. Signed-off-by: Gabriel Smith --- cortex-m-rt/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cortex-m-rt/src') diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index d73dc4f..31e4ea3 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -491,7 +491,7 @@ pub unsafe extern "C" fn Reset() -> ! { } let pre_init: unsafe extern "C" fn() = __pre_init; - if pre_init as usize != 0 { + if pre_init as usize != 1 { pre_init(); } -- cgit v1.2.3