From f9eed77b62ae7e28eee7a758cb4ce4f6fb962de3 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 26 Mar 2023 23:21:53 -0400 Subject: Fix bug for functions with no return --- tnslc/tnslc.tnsl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tnslc/tnslc.tnsl') diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl index b8e1189..c31c657 100644 --- a/tnslc/tnslc.tnsl +++ b/tnslc/tnslc.tnsl @@ -1768,6 +1768,12 @@ ;/ ;return false ;/ + + /; sprint [{}uint8] + ;return string_join( { + "Function ", self.name, " (", int_to_string(len(self.inputs)), ") ", self.output.sprint() + }, "") + ;/ ;/ ;struct Module { @@ -2705,6 +2711,10 @@ "\tcall ", f.full_label(), "\n" }, "") + /; if (string_equate(f.output.name, "")) + ;return {"", NO_TYPE, 0, 0} + ;/ + ;Type t = f.mod`.find_type(string_split(f.output.name, '.'))` ;t.ptr_chain = f.output.ptr_chain ;ctmp.data_type = t @@ -2712,6 +2722,7 @@ /; if (!(ctmp.is_prim()) && !(ctmp.is_ref())) ;ctmp.data_type.ptr_chain.append(PTYPE.REFERENCE) ;/ + ;log_debug("perf call ret") ;return ctmp ;/ -- cgit v1.2.3