mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
wasm gc: make stack trace deobfuscator work in Firefox
This commit is contained in:
parent
d37ab2a276
commit
2f678ccb6c
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
let globalsCache = new Map();
|
let globalsCache = new Map();
|
||||||
let stackDeobfuscator = null;
|
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 getGlobalName = function(name) {
|
||||||
let result = globalsCache.get(name);
|
let result = globalsCache.get(name);
|
||||||
if (typeof result === "undefined") {
|
if (typeof result === "undefined") {
|
||||||
|
@ -150,7 +150,7 @@ function coreImports(imports, context) {
|
||||||
let stack = new Error().stack;
|
let stack = new Error().stack;
|
||||||
let addresses = [];
|
let addresses = [];
|
||||||
for (let line of stack.split("\n")) {
|
for (let line of stack.split("\n")) {
|
||||||
let match = chromeExceptionRegex.exec(line);
|
let match = exceptionFrameRegex.exec(line);
|
||||||
if (match !== null && match.length >= 2) {
|
if (match !== null && match.length >= 2) {
|
||||||
let address = parseInt(match[1], 16);
|
let address = parseInt(match[1], 16);
|
||||||
addresses.push(address);
|
addresses.push(address);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user