2
0
Nicolas Cannasse 7 жил өмнө
parent
commit
5da52d3d0b
3 өөрчлөгдсөн 14 нэмэгдсэн , 8 устгасан
  1. 6 0
      src/hl.h
  2. 1 7
      src/jit.c
  3. 7 1
      src/std/error.c

+ 6 - 0
src/hl.h

@@ -770,6 +770,12 @@ typedef struct {
 #	define DEFINE_PRIM_WITH_NAME	_DEFINE_PRIM_WITH_NAME
 #endif
 
+#ifdef HL_GCC
+#	define HL_NO_OPT __attribute__((optimize("-O0")))
+#else
+#	define HL_NO_OPT
+#endif
+
 // -------------- EXTRA ------------------------------------
 
 #define hl_fatal(msg)			hl_fatal_error(msg,__FILE__,__LINE__)

+ 1 - 7
src/jit.c

@@ -1446,18 +1446,12 @@ static int prepare_call_args( jit_ctx *ctx, int count, int *args, vreg *vregs, i
 	return paddedSize;
 }
 
-// prevent remove of push ebp which would prevent our stack from being correctly reported
 #ifdef HL_VCC
 #	pragma optimize( "", off )
 #endif
-#ifdef HL_GCC
-__attribute__((optimize("-O0")))
-#endif
-
-static void hl_null_access() {
+HL_NO_OPT static void hl_null_access() {
 	hl_error_msg(USTR("Null access"));
 }
-
 #ifdef HL_VCC
 #	pragma optimize( "", on )
 #endif

+ 7 - 1
src/std/error.c

@@ -157,9 +157,15 @@ HL_PRIM void hl_fatal_fmt( const char *file, int line, const char *fmt, ...) {
 	hl_fatal_error(buf,file,line);
 }
 
-HL_PRIM void hl_breakpoint() {
+#ifdef HL_VCC
+#	pragma optimize( "", off )
+#endif
+HL_PRIM HL_NO_OPT void hl_breakpoint() {
 	hl_debug_break();
 }
+#ifdef HL_VCC
+#	pragma optimize( "", on )
+#endif
 
 #ifdef HL_LINUX__
 #include <signal.h>