Browse Source

* fixed bug with concatting 0-length shortstrings

Jonas Maebe 23 years ago
parent
commit
73c94020ee
1 changed files with 8 additions and 1 deletions
  1. 8 1
      rtl/powerpc/powerpc.inc

+ 8 - 1
rtl/powerpc/powerpc.inc

@@ -761,6 +761,8 @@ asm
       lbz     r9, 0(r4)
       lbz     r9, 0(r4)
       { load length result }
       { load length result }
       lbz     r10, 0(r3)
       lbz     r10, 0(r3)
+      { length 0? }
+      cmplwi  r10,0
       { go to last current character of result }
       { go to last current character of result }
       add     r4,r9,r4
       add     r4,r9,r4
 
 
@@ -773,10 +775,12 @@ asm
 
 
       { and concatenate }
       { and concatenate }
       mtctr   r9
       mtctr   r9
+      beq     LShortStrConcatDone
 LShortStrConcatLoop:
 LShortStrConcatLoop:
       lbzu    r10,1(r4)
       lbzu    r10,1(r4)
       stbu    r10,1(r3)
       stbu    r10,1(r3)
       bdnz    LShortStrConcatLoop
       bdnz    LShortStrConcatLoop
+LShortStrConcatDone:
 end ['R3','R4','R8','R9','R10','CTR'];
 end ['R3','R4','R8','R9','R10','CTR'];
 
 
 
 
@@ -952,7 +956,10 @@ end ['R3','R10'];
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.18  2002-09-07 16:01:26  peter
+  Revision 1.19  2002-09-10 17:47:20  jonas
+    * fixed bug with concatting 0-length shortstrings
+
+  Revision 1.18  2002/09/07 16:01:26  peter
     * old logs removed and tabs fixed
     * old logs removed and tabs fixed
 
 
   Revision 1.17  2002/08/31 21:29:57  florian
   Revision 1.17  2002/08/31 21:29:57  florian