mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 18:01:31 +00:00
Fix unreachable insertion when returning none (#557)
This commit is contained in:
@ -1746,13 +1746,8 @@ export class BinaryModule {
|
||||
/** Tests if an expression needs an explicit 'unreachable' when it is the terminating statement. */
|
||||
export function needsExplicitUnreachable(expr: ExpressionRef): bool {
|
||||
// not applicable if pushing a value to the stack
|
||||
switch (_BinaryenExpressionGetType(expr)) {
|
||||
case NativeType.I32:
|
||||
case NativeType.I64:
|
||||
case NativeType.F32:
|
||||
case NativeType.F64:
|
||||
case NativeType.V128: return false;
|
||||
}
|
||||
if (_BinaryenExpressionGetType(expr) != NativeType.Unreachable) return false;
|
||||
|
||||
switch (_BinaryenExpressionGetId(expr)) {
|
||||
case ExpressionId.Unreachable:
|
||||
case ExpressionId.Return: return false;
|
||||
|
Reference in New Issue
Block a user