Pārlūkot izejas kodu

* load an undef value in the function result in the exit code of a pure
assembler function, as the inline assembly code itself will be
responsible for returning the function result (we will have to add
the "return" instruction to it) while llvm requires a terminator
at the end of the function and it must return something

git-svn-id: trunk@30671 -

Jonas Maebe 10 gadi atpakaļ
vecāks
revīzija
4a25afb839
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      compiler/llvm/hlcgllvm.pas

+ 5 - 0
compiler/llvm/hlcgllvm.pas

@@ -1068,6 +1068,11 @@ implementation
             LOC_FPUREGISTER,
             LOC_MMREGISTER:
               begin
+                { inline assembler routines contain a ret at the end and never
+                  get here, but we do need a return at the end -> return an
+                  undefined value in this case }
+                if po_assembler in current_procinfo.procdef.procoptions then
+                  gen_load_uninitialized_function_result(list,current_procinfo.procdef,retpara.def,retpara);
                 { sign/zeroextension of function results is handled implicitly
                   via the signext/zeroext modifiers of the result, rather than
                   in the code generator -> remove any explicit extensions here }