@@ -87,6 +87,10 @@ typedef union
8787} dreg_type_t ;
8888
8989#ifdef IMPL_EXECUTE_LOOP
90+ // Override nifs.h RAISE_ERROR macro
91+ #ifdef RAISE_ERROR
92+ #undef RAISE_ERROR
93+ #endif
9094#define RAISE_ERROR (error_type_atom ) \
9195 ctx->x[0] = ERROR_ATOM; \
9296 ctx->x[1] = error_type_atom; \
@@ -1301,11 +1305,14 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
13011305
13021306#endif
13031307
1308+ #ifndef __clang__
13041309#pragma GCC diagnostic push
13051310#ifdef __GNUC__
1306- #ifndef __clang__
13071311#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
13081312#endif
1313+ #else
1314+ #pragma clang diagnostic push
1315+ #pragma clang diagnostic ignored "-Wunused-but-set-variable"
13091316#endif
13101317
13111318#ifdef IMPL_CODE_LOADER
@@ -3661,9 +3668,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
36613668 int next_off = 1 ;
36623669 uint32_t fail ;
36633670 DECODE_LABEL (fail , code , i , next_off )
3664- #ifdef IMPL_EXECUTE_LOOP
3665- int next_off_back = next_off ;
3666- #endif
36673671 term src ;
36683672 DECODE_COMPACT_TERM (src , code , i , next_off );
36693673 term arg2 ;
@@ -3707,9 +3711,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
37073711 int next_off = 1 ;
37083712 uint32_t fail ;
37093713 DECODE_LABEL (fail , code , i , next_off )
3710- #ifdef IMPL_EXECUTE_LOOP
3711- int next_off_back = next_off ;
3712- #endif
37133714 term src ;
37143715 DECODE_COMPACT_TERM (src , code , i , next_off );
37153716 term arg2 ;
@@ -3815,9 +3816,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
38153816 int next_off = 1 ;
38163817 uint32_t fail ;
38173818 DECODE_LABEL (fail , code , i , next_off )
3818- #ifdef IMPL_EXECUTE_LOOP
3819- int next_off_back = next_off ;
3820- #endif
38213819 term src ;
38223820 DECODE_COMPACT_TERM (src , code , i , next_off );
38233821 term arg2 ;
@@ -3861,9 +3859,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
38613859 int next_off = 1 ;
38623860 uint32_t fail ;
38633861 DECODE_LABEL (fail , code , i , next_off )
3864- #ifdef IMPL_EXECUTE_LOOP
3865- int next_off_back = next_off ;
3866- #endif
38673862 term src ;
38683863 DECODE_COMPACT_TERM (src , code , i , next_off );
38693864 term arg2 ;
@@ -3941,9 +3936,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
39413936 int next_off = 1 ;
39423937 uint32_t fail ;
39433938 DECODE_LABEL (fail , code , i , next_off )
3944- #ifdef IMPL_EXECUTE_LOOP
3945- int next_off_back = next_off ;
3946- #endif
39473939 term src ;
39483940 DECODE_COMPACT_TERM (src , code , i , next_off );
39493941 term arg2 ;
@@ -3986,9 +3978,6 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
39863978 int next_off = 1 ;
39873979 uint32_t fail ;
39883980 DECODE_LABEL (fail , code , i , next_off )
3989- #ifdef IMPL_EXECUTE_LOOP
3990- int next_off_back = next_off ;
3991- #endif
39923981 term src ;
39933982 DECODE_COMPACT_TERM (src , code , i , next_off );
39943983 term arg2 ;
@@ -4577,7 +4566,7 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
45774566 AVM_ABORT ();
45784567 }
45794568
4580- TRACE ("bs_save2/2, src=0x%lx pos=%li\n" , src , index_val );
4569+ TRACE ("bs_save2/2, src=0x%lx pos=%li\n" , src , index == START_ATOM ? -1 : index_val );
45814570 #endif
45824571
45834572 NEXT_INSTRUCTION (next_off );
@@ -4608,7 +4597,7 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
46084597 AVM_ABORT ();
46094598 }
46104599
4611- TRACE ("bs_restore2/2, src=0x%lx pos=%li\n" , src , index_val );
4600+ TRACE ("bs_restore2/2, src=0x%lx pos=%li\n" , src , index == START_ATOM ? -1 : index_val );
46124601 #endif
46134602
46144603 NEXT_INSTRUCTION (next_off );
@@ -5583,7 +5572,11 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
55835572 term src ;
55845573 DECODE_COMPACT_TERM (src , code , i , next_off );
55855574
5586- TRACE ("has_map_fields/3: label: %i src: 0x%lx\n" , label , src );
5575+ #ifdef IMPL_EXECUTE_LOOP
5576+ TRACE ("has_map_fields/3: label: %i src: 0x%lx\n" , label , src );
5577+ #else
5578+ TRACE ("has_map_fields/3: label: %i\n" , label );
5579+ #endif
55875580
55885581 DECODE_EXTENDED_LIST_TAG (code , i , next_off );
55895582 uint32_t list_len ;
@@ -5615,7 +5608,11 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
56155608 DECODE_LABEL (label , code , i , next_off )
56165609 term src ;
56175610 DECODE_COMPACT_TERM (src , code , i , next_off );
5618- TRACE ("get_map_elements/3: label: %i src: 0x%lx\n" , label , src );
5611+ #ifdef IMPL_EXECUTE_LOOP
5612+ TRACE ("get_map_elements/3: label: %i src: 0x%lx\n" , label , src );
5613+ #else
5614+ TRACE ("get_map_elements/3: label: %i\n" , label );
5615+ #endif
56195616
56205617 DECODE_EXTENDED_LIST_TAG (code , i , next_off );
56215618 uint32_t list_len ;
@@ -6927,6 +6924,10 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
69276924 }
69286925}
69296926
6927+ #ifndef __clang__
69306928#pragma GCC diagnostic pop
6929+ #else
6930+ #pragma clang diagnostic pop
6931+ #endif
69316932
69326933#undef DECODE_COMPACT_TERM
0 commit comments