Skip to content

Commit 4671644

Browse files
committed
Disable computed goto under emscripten
Computed goto is apparently supported using the fastcomp/LLVM -> asm.js -> wasm path, but not the upstream LLVM -> wasm path (at least not at the moment). For now simply always disable computed goto under Emscripten.
1 parent cb1e583 commit 4671644

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/flisp/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ FLAGS := -I$(LLTDIR) $(JCFLAGS) $(HFILEDIRS:%=-I%) \
3333
-I$(LIBUV_INC) -I$(UTF8PROC_INC) -I$(build_includedir) $(LIBDIRS:%=-L%) \
3434
-DLIBRARY_EXPORTS -DUTF8PROC_EXPORTS
3535
ifneq ($(USEMSVC), 1)
36-
FLAGS += -Wall -Wno-strict-aliasing -DUSE_COMPUTED_GOTO -fvisibility=hidden -Wpointer-arith -Wundef
36+
ifneq ($(OS), emscripten)
37+
FLAGS += -DUSE_COMPUTED_GOTO
38+
endif
39+
FLAGS += -Wall -Wno-strict-aliasing -fvisibility=hidden -Wpointer-arith -Wundef
3740
FLAGS += -Wold-style-definition -Wstrict-prototypes -Wc++-compat
3841
endif
3942

src/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ STATIC_INLINE int gc_mark_scan_obj32(jl_ptls_t ptls, jl_gc_mark_sp_t *sp, gc_mar
18491849
return 0;
18501850
}
18511851

1852-
#ifdef __GNUC__
1852+
#if defined(__GNUC__) && !defined(__OS_EMSCRIPTEN__)
18531853
# define gc_mark_laddr(name) (&&name)
18541854
# define gc_mark_jmp(ptr) goto *(ptr)
18551855
#else

0 commit comments

Comments
 (0)