The concatenation result is invalid and may even cause a crash if one attempts to print the string:
Code: Select all
Sub doubleString (Byref s0 As String)
s0 &= s0
End Sub
Dim As String s = "FreeBASIC"
doubleString(s)
Print "'" & s & "'"
Sleep
I see this change in the 'changelog.txt' file (Version 1.08.0):
[change]
- optimize byref 'm += s' string concatenations to fb_StrConcatByref() which will check for same string descriptor at run-time which can't be determined at compile time for byref parameters.
[fixed]
- sf.net #917: optimize 'm += s' string concatenations to fix the long compile times in the gcc backend (which makes heavy use of string building).