You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash on invalid abstract export class declaration inside a namespace #3045
Hi, I found that asc crashes while compiling the following AssemblyScript code snippet. I would expect a normal compilation error rather than a compiler crash.
Steps to reproduce
// bad.tsnamespaceN{abstractexportclassC{}}
> node ~/assemblyscript/bin/asc --optimizeLevel 2 --shrinkLevel 2 bad.ts -o bad.wasm
Output:
▌ Whoops, the AssemblyScript compiler has crashed during initialize :-(
▌
▌ Here is the stack trace hinting at the problem, perhaps it's useful?▌▌ AssertionError: assertion failed▌ at Y.assert (~/assemblyscript/std/portable/index.js:216:11)▌ at On.initializeNamespace (~/assemblyscript/src/program.ts:2813:18)▌ at On.initialize (~/assemblyscript/src/program.ts:1144:18)▌ at Module.MS (~/assemblyscript/src/index-wasm.ts:354:11)▌ at Module.De (~/assemblyscript/cli/index.js:714:22)▌ at async file:///~/assemblyscript/bin/asc.js:33:22
Other findings
The valid modifier order inside a namespace does not crash:
namespaceN{exportabstractclassC{}}
The same invalid modifier order at the top level reports a normal compilation error instead of crashing:
Activity