Skip to content

Commit

Permalink
Merge pull request #56 from silbinarywolf/add-extra-memory-safety-che…
Browse files Browse the repository at this point in the history
…cks-for-emscripten

add SAFE_HEAP=1 and STACK_OVERFLOW_CHECK=1 for Emscripten Debug builds
  • Loading branch information
floooh authored Feb 19, 2024
2 parents e0df69d + a40a8b9 commit 4b046bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ pub fn emLinkStep(b: *Build, options: EmLinkOptions) !*Build.Step.Run {
try emcc_cmd.append(emcc_path);
if (options.optimize == .Debug) {
try emcc_cmd.append("-Og");
try emcc_cmd.append("-sSAFE_HEAP=1");
try emcc_cmd.append("-sSTACK_OVERFLOW_CHECK=1");
} else {
try emcc_cmd.append("-sASSERTIONS=0");
if (options.optimize == .ReleaseSmall) {
Expand Down

0 comments on commit 4b046bc

Please sign in to comment.