@webassemblyjs/wasm-parser
Advanced tools
Comparing version 1.1.2-y.4 to 1.1.2-y.5
@@ -500,2 +500,3 @@ "use strict"; | ||
for (var i = 0; i < numberOfFuncs; i++) { | ||
var startLoc = getPosition(); | ||
dumpSep("function body " + i); // the u32 size of the function code in bytes | ||
@@ -506,3 +507,3 @@ // Ignore it for now | ||
eatBytes(bodySizeU32.nextIndex); | ||
dump([0x0], "function body size (guess)"); | ||
dump([bodySizeU32.value], "function body size"); | ||
var code = []; | ||
@@ -536,5 +537,9 @@ /** | ||
parseInstructionBlock(code); | ||
var endLoc = getPosition(); | ||
state.elementsInCodeSection.push({ | ||
code: code, | ||
locals: locals | ||
locals: locals, | ||
endLoc: endLoc, | ||
startLoc: startLoc, | ||
bodySize: bodySizeU32.value | ||
}); | ||
@@ -1263,2 +1268,13 @@ } | ||
funcNode.isExternal = func.isExternal; | ||
} // Add function position in the binary if possible | ||
if (opts.ignoreCodeSection === false) { | ||
var startLoc = decodedElementInCodeSection.startLoc, | ||
endLoc = decodedElementInCodeSection.endLoc, | ||
bodySize = decodedElementInCodeSection.bodySize; | ||
funcNode = t.withLoc(funcNode, endLoc, startLoc); | ||
funcNode.metadata = { | ||
bodySize: bodySize | ||
}; | ||
} | ||
@@ -1265,0 +1281,0 @@ |
{ | ||
"name": "@webassemblyjs/wasm-parser", | ||
"version": "1.1.2-y.4", | ||
"version": "1.1.2-y.5", | ||
"keywords": [ | ||
@@ -19,7 +19,7 @@ "webassembly", | ||
"dependencies": { | ||
"@webassemblyjs/ast": "1.1.2-y.4", | ||
"@webassemblyjs/helper-leb128": "1.1.2-y.4", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.1.2-y.4", | ||
"@webassemblyjs/wasm-parser": "1.1.2-y.4", | ||
"webassemblyjs": "1.1.2-y.4" | ||
"@webassemblyjs/ast": "1.1.2-y.5", | ||
"@webassemblyjs/helper-leb128": "1.1.2-y.5", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.1.2-y.5", | ||
"@webassemblyjs/wasm-parser": "1.1.2-y.5", | ||
"webassemblyjs": "1.1.2-y.5" | ||
}, | ||
@@ -26,0 +26,0 @@ "repository": { |
@@ -551,2 +551,4 @@ // @flow | ||
for (let i = 0; i < numberOfFuncs; i++) { | ||
const startLoc = getPosition(); | ||
dumpSep("function body " + i); | ||
@@ -559,3 +561,3 @@ | ||
dump([0x0], "function body size (guess)"); | ||
dump([bodySizeU32.value], "function body size"); | ||
@@ -597,5 +599,11 @@ const code: Array<Instruction> = []; | ||
const endLoc = getPosition(); | ||
state.elementsInCodeSection.push({ | ||
code, | ||
locals | ||
locals, | ||
endLoc, | ||
startLoc, | ||
bodySize: bodySizeU32.value | ||
}); | ||
@@ -1434,3 +1442,3 @@ } | ||
const funcNode = t.func(func.id, params, result, body); | ||
let funcNode = t.func(func.id, params, result, body); | ||
@@ -1441,2 +1449,10 @@ if (func.isExternal === true) { | ||
// Add function position in the binary if possible | ||
if (opts.ignoreCodeSection === false) { | ||
const { startLoc, endLoc, bodySize } = decodedElementInCodeSection; | ||
funcNode = t.withLoc(funcNode, endLoc, startLoc); | ||
funcNode.metadata = { bodySize }; | ||
} | ||
moduleFields.push(funcNode); | ||
@@ -1443,0 +1459,0 @@ }); |
@@ -58,2 +58,5 @@ // @flow | ||
type DecodedElementInCodeSection = { | ||
startLoc: Position, | ||
endLoc: Position, | ||
bodySize: number, | ||
code: Array<Instruction>, | ||
@@ -60,0 +63,0 @@ locals: Array<Valtype> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81702
2435
+ Added@webassemblyjs/ast@1.1.2-y.5(transitive)
+ Added@webassemblyjs/helper-leb128@1.1.2-y.5(transitive)
+ Added@webassemblyjs/helper-wasm-bytecode@1.1.2-y.5(transitive)
+ Added@webassemblyjs/wast-parser@1.1.2-y.5(transitive)
+ Addedwebassemblyjs@1.1.2-y.5(transitive)
- Removed@webassemblyjs/ast@1.1.2-y.4(transitive)
- Removed@webassemblyjs/helper-leb128@1.1.2-y.4(transitive)
- Removed@webassemblyjs/helper-wasm-bytecode@1.1.2-y.4(transitive)
- Removed@webassemblyjs/wast-parser@1.1.2-y.4(transitive)
- Removedwebassemblyjs@1.1.2-y.4(transitive)
Updated@webassemblyjs/ast@1.1.2-y.5
Updatedwebassemblyjs@1.1.2-y.5