Browse Source

* re-read the libbase already pushed on the stack for AROS syscalls, instead of trying to re-resolve it. should fix threadvar libbases on AROS.

git-svn-id: trunk@33455 -
Károly Balogh 9 years ago
parent
commit
4ed3a3f09a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/i386/n386cal.pas

+ 5 - 1
compiler/i386/n386cal.pas

@@ -69,7 +69,11 @@ implementation
               // one syscall convention for AROS
               // one syscall convention for AROS
               current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('AROS SysCall')));
               current_asmdata.CurrAsmList.concat(tai_comment.create(strpnew('AROS SysCall')));
               reference_reset(tmpref,sizeof(pint));
               reference_reset(tmpref,sizeof(pint));
-              tmpref.symbol:=current_asmdata.RefAsmSymbol(tstaticvarsym(tcpuprocdef(procdefinition).libsym).mangledname);
+              { re-read the libbase pushed first on the stack, instead of just trusting the
+                mangledname will work. this is important for example for threadvar libbases.
+                and this way they also don't need to be resolved twice then. (KB) }
+              tmpref.base:=NR_ESP;
+              tmpref.offset:=pushedparasize-sizeof(pint);
               cg.getcpuregister(current_asmdata.CurrAsmList,NR_EAX);
               cg.getcpuregister(current_asmdata.CurrAsmList,NR_EAX);
               cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,tmpref,NR_EAX);
               cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,tmpref,NR_EAX);
               reference_reset_base(tmpref,NR_EAX,-tprocdef(procdefinition).extnumber,sizeof(pint));
               reference_reset_base(tmpref,NR_EAX,-tprocdef(procdefinition).extnumber,sizeof(pint));