From fca7a90869ae992b141d3a5a0f9c68ff65c2fe68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sun, 22 May 2022 09:40:40 +0200 Subject: [PATCH] readChar: Remove unreachable --- src/waforth.wat | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/waforth.wat b/src/waforth.wat index 77087b7..a934749 100644 --- a/src/waforth.wat +++ b/src/waforth.wat @@ -2756,15 +2756,14 @@ (func $readChar (result i32) (local $n i32) (local $in i32) - (if (i32.ge_u (local.tee $in (i32.load (i32.const 0x21908 (; body(>IN) ;)))) + (if (result i32) (i32.ge_u (local.tee $in (i32.load (i32.const 0x21908 (; body(>IN) ;)))) (global.get $inputBufferSize)) (then - (return (i32.const -1))) + (i32.const -1)) (else (local.set $n (i32.load8_s (i32.add (global.get $inputBufferBase) (local.get $in)))) (i32.store (i32.const 0x21908 (; body(>IN) ;)) (i32.add (local.get $in) (i32.const 1))) - (return (local.get $n)))) - (unreachable)) + (local.get $n)))) (func $numberToChar (param $v i32) (result i32) (if (result i32) (i32.ge_u (local.get $v) (i32.const 10))