Skip to content

Commit 1a111e1

Browse files
committed
fix compilation for MSVC32
GPR#938 broke compilation for MSVC32: the stack probing in the runtime isn't implemented on Win32 (i386nt.asm), so the enhanced Is_in_code_area macro should only be used in the Win64-specific part of byterun/win32.c.
1 parent 720989c commit 1a111e1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

byterun/win32.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -521,16 +521,6 @@ static void caml_reset_stack (void *faulting_address)
521521
caml_raise_stack_overflow();
522522
}
523523

524-
/* Do not use the macro from address_class.h here. */
525-
#undef Is_in_code_area
526-
#define Is_in_code_area(pc) \
527-
( ((char *)(pc) >= caml_code_area_start && \
528-
(char *)(pc) <= caml_code_area_end) \
529-
|| ((char *)(pc) >= &caml_system__code_begin && \
530-
(char *)(pc) <= &caml_system__code_end) \
531-
|| (Classify_addr(pc) & In_code_area) )
532-
extern char caml_system__code_begin, caml_system__code_end;
533-
534524

535525
#ifndef _WIN64
536526
static LONG CALLBACK
@@ -565,6 +555,17 @@ static LONG CALLBACK
565555
extern char *caml_exception_pointer;
566556
extern value *caml_young_ptr;
567557

558+
/* Do not use the macro from address_class.h here. */
559+
#undef Is_in_code_area
560+
#define Is_in_code_area(pc) \
561+
( ((char *)(pc) >= caml_code_area_start && \
562+
(char *)(pc) <= caml_code_area_end) \
563+
|| ((char *)(pc) >= &caml_system__code_begin && \
564+
(char *)(pc) <= &caml_system__code_end) \
565+
|| (Classify_addr(pc) & In_code_area) )
566+
extern char caml_system__code_begin, caml_system__code_end;
567+
568+
568569
static LONG CALLBACK
569570
caml_stack_overflow_VEH (EXCEPTION_POINTERS* exn_info)
570571
{

0 commit comments

Comments
 (0)