Browse Source

* arm: Re-enabled "inline" on "fpc_ansistr_decr_ref" and "fpc_ansistr_incr_ref".

J. Gareth "Curious Kit" Moreton 1 year ago
parent
commit
d729d5a5b1
1 changed files with 4 additions and 9 deletions
  1. 4 9
      rtl/inc/compproc.inc

+ 4 - 9
rtl/inc/compproc.inc

@@ -302,15 +302,10 @@ Function fpc_Val_smallint_UnicodeStr (Const S : UnicodeString; out Code : ValSIn
 {$endif CPU16 or CPU8}
 {$endif CPU16 or CPU8}
 
 
 {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
 {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
-{ There is a glitch in the compiler (present in FPC 3.2.2 and beyond) that
-  prevents these two subroutines from working properly with the inline
-  directive under ARM.  This is almost certainly related to the fact that the
-  implementation is a pure assembler routine.
-
-  TODO: Actually fix the compiler bug rather than avoid triggering it. [Kit]
-}
-Procedure fpc_ansistr_decr_ref (Var S : Pointer); compilerproc; {$ifndef arm}inline;{$endif not arm}
-Procedure fpc_ansistr_incr_ref (S : Pointer); compilerproc; {$ifndef arm}inline;{$endif not arm}
+{ A glitch in FPC 3.2.2 prevents inline from working properly here on
+  ARM (causes a dangling pointer and hence heap corrpution). }
+Procedure fpc_ansistr_decr_ref (Var S : Pointer); compilerproc; {$if FPC_FULLVERSION>30202}inline;{$ifend}
+Procedure fpc_ansistr_incr_ref (S : Pointer); compilerproc; {$if FPC_FULLVERSION>30202}inline;{$ifend}
 Procedure fpc_AnsiStr_Assign (Var DestS : Pointer;S2 : Pointer); compilerproc;
 Procedure fpc_AnsiStr_Assign (Var DestS : Pointer;S2 : Pointer); compilerproc;
 Procedure fpc_AnsiStr_Concat (Var DestS : RawByteString;const S1,S2 : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
 Procedure fpc_AnsiStr_Concat (Var DestS : RawByteString;const S1,S2 : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
 Procedure fpc_AnsiStr_Concat_multi (Var DestS : RawByteString;const sarr:array of RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
 Procedure fpc_AnsiStr_Concat_multi (Var DestS : RawByteString;const sarr:array of RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;