From 2f12c7fa504a09ea4cb20ee42214f382cf8a879a Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Thu, 28 Dec 2017 15:20:37 +0100 Subject: [PATCH] Fix local type being possibly null --- src/program.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/program.ts b/src/program.ts index 775bddd5..0c865a3a 100644 --- a/src/program.ts +++ b/src/program.ts @@ -1485,7 +1485,8 @@ export class Function extends Element { /** Frees the temporary local for reuse. */ freeTempLocal(local: Local): void { var temps: Local[]; - switch (local.type.toNativeType()) { + assert(local.type != null); + switch ((local.type).toNativeType()) { case NativeType.I32: temps = this.tempI32s || (this.tempI32s = []); break; case NativeType.I64: temps = this.tempI64s || (this.tempI64s = []); break; case NativeType.F32: temps = this.tempF32s || (this.tempF32s = []); break;