From 3dcec77fb7bff637929555a2c6883991cb18430e Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Mon, 13 Apr 2020 10:50:57 +0200 Subject: [PATCH] Added proper error when returning value from void function. Closes #400 --- .../kickc/passes/Pass0GenerateStatementSequence.java | 3 +++ src/test/java/dk/camelot64/kickc/test/TestPrograms.java | 5 +++++ src/test/kc/returnfromvoid.c | 9 +++++++++ 3 files changed, 17 insertions(+) create mode 100644 src/test/kc/returnfromvoid.c diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java b/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java index d7d239728..52e89dc0a 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java @@ -1678,6 +1678,9 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor