From 835555171ed6edec9f320d2dce27f50794669c85 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 15 Mar 2020 00:47:21 +0100 Subject: [PATCH] fix function call arg type mismatch crash --- compiler/src/prog8/ast/processing/AstChecker.kt | 2 ++ examples/lines-circles.p8 | 2 -- examples/test.p8 | 10 +--------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/compiler/src/prog8/ast/processing/AstChecker.kt b/compiler/src/prog8/ast/processing/AstChecker.kt index 1dca4ba5e..ac314a032 100644 --- a/compiler/src/prog8/ast/processing/AstChecker.kt +++ b/compiler/src/prog8/ast/processing/AstChecker.kt @@ -1066,6 +1066,8 @@ internal class AstChecker(private val program: Program, if(stmt is Return && index < statements.lastIndex) errors.warn("unreachable code, return statement above", statements[index+1].position) + + stmt.accept(this) } } diff --git a/examples/lines-circles.p8 b/examples/lines-circles.p8 index 1baff3981..2a825aa3b 100644 --- a/examples/lines-circles.p8 +++ b/examples/lines-circles.p8 @@ -24,8 +24,6 @@ main { line(20, 4, 10, 24) line(39, 16, 12, 0) - ; TODO fix crash arg type incompatible c64scr.setcc(x0, y0 + radius, 81, 1) - sub line(ubyte x1, ubyte y1, ubyte x2, ubyte y2) { byte d = 0 ubyte dx = abs(x2 - x1) diff --git a/examples/test.p8 b/examples/test.p8 index bba8d407a..cec9d29d2 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,17 +1,9 @@ +%import c64utils %zeropage basicsafe main { sub start() { - if A>Y { - label1: - Y=0 - goto label1 - } else { - label2: - Y=1 - goto label2 - } c64scr.print("spstart:") print_stackpointer()