From ed3aa5be3503dc71edfb0c7d7446ec8cbc2f8b28 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 8 May 2017 20:06:20 +0200 Subject: [PATCH] mescc: Support void return. * module/language/c99/compiler.mes (ast-info): Support `return'. --- module/language/c99/compiler.mes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/language/c99/compiler.mes b/module/language/c99/compiler.mes index b0ff4d6c..51edc307 100644 --- a/module/language/c99/compiler.mes +++ b/module/language/c99/compiler.mes @@ -1221,7 +1221,6 @@ (1+ (local:id (cdar locals))))) (locals (cons (make-local name type pointer id) locals))) locals)) - (pmatch o (((trans-unit . _) . _) ((ast-list->info info) o)) @@ -1454,6 +1453,9 @@ (list (lambda (f g ta t d) (jump (- (label-offset (.function info) label f) offset)))))))) + ((return (expr)) + (append-text info (append (wrap-as (i386:ret))))) + ((return ,expr) (let ((info ((expr->accu info) expr))) (append-text info (append (wrap-as (i386:ret))))))