Explorar o código

+ emit a ret instruction at the end of functions

git-svn-id: branches/z80@44485 -
nickysn %!s(int64=5) %!d(string=hai) anos
pai
achega
050244e5f0
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      compiler/z80/cgcpu.pas

+ 4 - 3
compiler/z80/cgcpu.pas

@@ -1719,11 +1719,12 @@ unit cgcpu;
         reg : TSuperRegister;
         LocalSize : longint;
       begin
-        { every byte counts for avr, so if a subroutine is marked as non-returning, we do
+        { every byte counts for Z80, so if a subroutine is marked as non-returning, we do
           not generate any exit code, so we really trust the noreturn directive
         }
-        //if po_noreturn in current_procinfo.procdef.procoptions then
-        //  exit;
+        if po_noreturn in current_procinfo.procdef.procoptions then
+          exit;
+        list.concat(taicpu.op_none(A_RET));
         //if po_interrupt in current_procinfo.procdef.procoptions then
         //  begin
         //    regs:=rg[R_INTREGISTER].used_in_proc;