Skip to content

Fix OOM running acorn optimizer on binaryen_js #24559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jun 12, 2025

See #24558

@sbc100 sbc100 requested a review from dschuff June 12, 2025 23:28
@sbc100 sbc100 requested a review from kripken June 12, 2025 23:42
@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 12, 2025

The test expectations here looks like they are due to ; and extra braces:

$ diff -u -w  out/test/a.out.js  new/a.out.js 
--- out/test/a.out.js	2025-06-12 16:43:30.323106773 -0700
+++ new/a.out.js	2025-06-12 16:43:30.319106773 -0700
@@ -21,7 +21,7 @@
     process.argv.slice(2)
   } else if (g || h) {
     try {
-      m = new URL(".", l).href
+      m = (new URL(".", l)).href
     } catch {
     }
     h && (p = a => {
@@ -46,7 +46,7 @@
       var b = await fetch(a, {credentials : "same-origin"});
       if (b.ok)
         return b.arrayBuffer();
-      throw Error(b.status + " : " + b.url)
+      throw Error(b.status + " : " + b.url);
     }
   }
   console.log.bind(console);
@@ -72,7 +72,7 @@
       throw r(`failed to asynchronously prepare wasm: ${d}`),
           a = d, a = "Aborted(" + a + ")", r(a), t = !0,
           a = new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info."), v?.(a),
-          a
+          a;
     }
   }
   async function D(a) {
@@ -87,10 +87,11 @@
     return C(b, a)
   }
   e._global_val = 1024;
-  var E = {}, F = await (async function() {
+  var E = {},
+      F = await (async function() {
                 y++;
                 var a = {a : E};
-                A ??= e.locateFile ? m + "a.out.wasm" : new URL("a.out.wasm", import.meta.url).href;
+        A ??= e.locateFile ? m + "a.out.wasm" : (new URL("a.out.wasm", import.meta.url)).href;
                 F = (await D(a)).instance.exports;
                 w = F.a;
                 a = w.buffer;
@@ -115,6 +116,7 @@
                         u = a;
                         v = b
                       });
+  ;
   return moduleRtn
 }
 export default Module;

@sbc100 sbc100 merged commit be89742 into emscripten-core:main Jun 13, 2025
3 of 13 checks passed
@sbc100 sbc100 deleted the fix_oom branch June 13, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants