From 5f45c58b33080a4602d8faeba453ecfbc6326f5d Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Thu, 7 Jan 2021 20:54:48 -0300 Subject: [PATCH] Fix NULL statements function declarations --- compiler/compiler-structure.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler/compiler-structure.c b/compiler/compiler-structure.c index a029282..606976d 100644 --- a/compiler/compiler-structure.c +++ b/compiler/compiler-structure.c @@ -92,13 +92,9 @@ LINEBLOCK* compilefunbody(SCOPE* s, CLASS* cl, SUBROUTDEC* d) { LINEBLOCK* compilefundec(SCOPE* s, CLASS* cl, SUBROUTDEC* f) { LINE* label = mksubdeclabel(cl, f); - if(f->body->statements != NULL) { - LINEBLOCK* body = compilefunbody(s, cl, f); - appendlnbefore(body, label); - return body; - } - else - return mklnblk(label); + LINEBLOCK* body = compilefunbody(s, cl, f); + appendlnbefore(body, label); + return body; } LINEBLOCK* compileconstructor(SCOPE* s, CLASS* cl, SUBROUTDEC* con) {