Browse Source

* Fixed i386 longjmp, it must not return 0 if 'value' argument happens to be 0.

git-svn-id: trunk@22781 -
sergei 13 years ago
parent
commit
c0f49951b1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      rtl/i386/setjump.inc

+ 4 - 0
rtl/i386/setjump.inc

@@ -31,6 +31,10 @@ end;
 Procedure fpc_longJmp (Var S : Jmp_buf; value : longint); assembler;nostackframe;[Public, alias : 'FPC_LONGJMP']; compilerproc;
 Procedure fpc_longJmp (Var S : Jmp_buf; value : longint); assembler;nostackframe;[Public, alias : 'FPC_LONGJMP']; compilerproc;
 asm
 asm
   xchgl %edx,%eax
   xchgl %edx,%eax
+  testl %eax,%eax
+  jnz   .L1
+  incl  %eax
+.L1:
   movl Jmp_buf.ebx(%edx),%ebx
   movl Jmp_buf.ebx(%edx),%ebx
   movl Jmp_buf.esi(%edx),%esi
   movl Jmp_buf.esi(%edx),%esi
   movl Jmp_buf.edi(%edx),%edi
   movl Jmp_buf.edi(%edx),%edi