Skip to content

Crashed when using v128 intrinsic and float #2441

Closed
@vallsv

Description

@vallsv

Hi,

I don't know it it is still useful for you, but here is a crash of the compiler with a wrong float param in a v128 intrinsic method.

export function failing(): void {
  const z = f32x4.splat(0);
  const v: f32 = 0
  v128.add<f32>(z, v);
}
$ npx --version
7.21.0
npx asc assembly/images_as_simd_mem4.ts -o public/images_as_simd_mem4.wasm -O3 -Ospeed -t assembly/images_as_simd_mem4.ts.wat --converge --target release --importMemory --sourceMap --enable simd --runtime stub

▌ Whoops, the AssemblyScript compiler has crashed during compile :-(
▌ 
▌ Here is the stack trace hinting at the problem, perhaps it's useful?
▌ 
▌ /home/v/workspace/react/react-wasm/node_modules/assemblyscript/std/portable/index.js:200
▌     throw new AssertionError(message);
▌           ^
▌ 
▌ AssertionError: void type expected
▌     at null.Z.assert (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/std/portable/index.js:200:11)
▌     at Tr.convertExpression (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:3657:9)
▌     at Tr.compileExpression (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:3498:21)
▌     at null.Rr (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/builtins.ts:4678:23)
▌     at Tr.compileCallExpressionBuiltin (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:6574:49)
▌     at Tr.compileCallExpression (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:6335:23)
▌     at Tr.compileExpression (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:3417:21)
▌     at Tr.compileExpressionStatement (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:2448:17)
▌     at Tr.compileStatement (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:2136:21)
▌     at Tr.compileStatements (/home/v/workspace/react/react-wasm/node_modules/assemblyscript/src/compiler.ts:2220:23)
▌ 
▌ If you see where the error is, feel free to send us a pull request. If not,
▌ please let us know: https://github.com/AssemblyScript/assemblyscript/issues
▌ 
▌ Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions