Skip to content

Commit

Permalink
wasm gc: make stack trace deobfuscator work in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
konsoletyper committed Oct 14, 2024
1 parent d37ab2a commit 2f678cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/js/wasm-gc-runtime/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

let globalsCache = new Map();
let stackDeobfuscator = null;
let chromeExceptionRegex = / *at .+\.wasm:wasm-function\[[0-9]+]:0x([0-9a-f]+).*/;
let exceptionFrameRegex = /.+\.wasm:wasm-function\[[0-9]+]:0x([0-9a-f]+).*/;
let getGlobalName = function(name) {
let result = globalsCache.get(name);
if (typeof result === "undefined") {
Expand Down Expand Up @@ -150,7 +150,7 @@ function coreImports(imports, context) {
let stack = new Error().stack;
let addresses = [];
for (let line of stack.split("\n")) {
let match = chromeExceptionRegex.exec(line);
let match = exceptionFrameRegex.exec(line);
if (match !== null && match.length >= 2) {
let address = parseInt(match[1], 16);
addresses.push(address);
Expand Down

0 comments on commit 2f678cc

Please sign in to comment.