We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After compilation, some debug info (sourcemap) missed for $assembly/index/testFoo<assembly/index/AA|null> funciton.
$assembly/index/testFoo<assembly/index/AA|null>
I prepared a reproduce repo: https://github.com/JesseCodeBones/miss_debug_info for this function, this part of debug info will be missed:
if(v.length > 10) { return 2; } else { return 3; }
below is the output for function $assembly/index/testFoo<assembly/index/AA|null> and $assembly/index/testFoo<assembly/index/AA>
$assembly/index/testFoo<assembly/index/AA>
(func $assembly/index/testFoo<assembly/index/AA|null> (param $v i32) (result i32) (local $1 i32) (global.set $~lib/memory/__stack_pointer (i32.sub (global.get $~lib/memory/__stack_pointer) (i32.const 4) ) ) (call $~stack_check) (i32.store (global.get $~lib/memory/__stack_pointer) (i32.const 0) ) ;;@ assembly/index.ts:6:28 (if (i32.eq ;;@ assembly/index.ts:6:23 (local.get $v) ;;@ assembly/index.ts:6:28 (i32.const 0) ) (block ;;@ assembly/index.ts:7:11 (local.set $1 (i32.const 1) ) (global.set $~lib/memory/__stack_pointer (i32.add (global.get $~lib/memory/__stack_pointer) (i32.const 4) ) ) ;;@ assembly/index.ts:7:4 (return (local.get $1) ) ) ) (local.set $1 (local.get $v) ) (i32.store (global.get $~lib/memory/__stack_pointer) (local.get $1) ) (if (i32.gt_s (call $assembly/index/AA#get:length <--------------------**from here the debug info missed ** (local.get $1) ) (i32.const 10) ) (block (local.set $1 (i32.const 2) ) (global.set $~lib/memory/__stack_pointer (i32.add (global.get $~lib/memory/__stack_pointer) (i32.const 4) ) ) (return (local.get $1) ) ) (block (local.set $1 (i32.const 3) ) (global.set $~lib/memory/__stack_pointer (i32.add (global.get $~lib/memory/__stack_pointer) (i32.const 4) ) ) (return (local.get $1) ) ) ) )
but debug info for $assembly/index/testFoo<assembly/index/AA> is good:
(func $assembly/index/testFoo<assembly/index/AA> (param $v i32) (result i32) (local $1 i32) (global.set $~lib/memory/__stack_pointer (i32.sub (global.get $~lib/memory/__stack_pointer) (i32.const 4) ) ) (call $~stack_check) (i32.store (global.get $~lib/memory/__stack_pointer) (i32.const 0) ) ;;@ assembly/index.ts:6:6 (drop (i32.const 0) ) ;;@ assembly/index.ts:9:6 (local.set $1 (local.get $v) ) (i32.store (global.get $~lib/memory/__stack_pointer) (local.get $1) ) ;;@ assembly/index.ts:9:17 (if (i32.gt_s ;;@ assembly/index.ts:9:6 (call $assembly/index/AA#get:length (local.get $1) ) ;;@ assembly/index.ts:9:17 (i32.const 10) ) (block ;;@ assembly/index.ts:10:11 (local.set $1 (i32.const 2) ) (global.set $~lib/memory/__stack_pointer (i32.add (global.get $~lib/memory/__stack_pointer) (i32.const 4) ) ) ;;@ assembly/index.ts:10:4 (return (local.get $1) ) ) (block ;;@ assembly/index.ts:12:11 (local.set $1 (i32.const 3) ) (global.set $~lib/memory/__stack_pointer (i32.add (global.get $~lib/memory/__stack_pointer) (i32.const 4) ) ) ;;@ assembly/index.ts:12:4 (return (local.get $1) ) ) ) )
class AA { length: i32 = 1 } function testFoo<T>(v: T): i32 { if (isNullable(v) && v == null) { return 1; } if (v.length > 10) { return 2; } else { return 3; } } export function testExport(): void { testFoo<AA | null>(null); const a = new AA(); testFoo(a); }
asc assembly/index.ts --debug --disable bulk-memory --sourceMap --textFile --outFile dist/test.wasm
[wasm-opt executable] dist/test.wasm -ism dist/test.wasm.map --print
v0.27.2
The text was updated successfully, but these errors were encountered:
For quick check, please refer the output of action: https://github.com/JesseCodeBones/miss_debug_info/actions/runs/4729454293/jobs/8391987558
Sorry, something went wrong.
try to fix in binaryen: WebAssembly/binaryen#5547 close this issue
Successfully merging a pull request may close this issue.
Bug description
After compilation, some debug info (sourcemap) missed for
$assembly/index/testFoo<assembly/index/AA|null>
funciton.I prepared a reproduce repo: https://github.com/JesseCodeBones/miss_debug_info
for this function, this part of debug info will be missed:
below is the output for function
$assembly/index/testFoo<assembly/index/AA|null>
and$assembly/index/testFoo<assembly/index/AA>
but debug info for
$assembly/index/testFoo<assembly/index/AA>
is good:Steps to reproduce
asc assembly/index.ts --debug --disable bulk-memory --sourceMap --textFile --outFile dist/test.wasm
[wasm-opt executable] dist/test.wasm -ism dist/test.wasm.map --print
AssemblyScript version
v0.27.2
The text was updated successfully, but these errors were encountered: