View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037465 | FPC | Compiler | public | 2020-08-01 19:47 | 2020-08-23 13:28 |
Reporter | Frederic | Assigned To | Jonas Maebe | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.2.0 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0037465: Out Parameter referencing char of string not set when inlineing the function | ||||
Description | When a char of a string is used as out parameter for an inline function (or var parameter) then the function will simply not set the result, i.e. the write operations are discarded | ||||
Steps To Reproduce | See example | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 37465 | ||||
FPCOldBugId | |||||
FPCTarget | 3.2.2 | ||||
Attached Files |
|
|
example.pas (172 bytes)
program example; {$mode objfpc}{$H+} procedure foo(out c: char); inline; begin c := #32; end; var s: String; begin s:=#42; foo(s[1]); Writeln(ord(s[1])); end. |
|
Yes, you are correct 3.2.0 is generating non working code, it's also generating more code over what 3.0.4 for this operation. I looked at the ASM code and it is non working code with inline.. Also.. I wanted to thank you for putting this report here because I have an app that has DLL's and when using 3.2.0 the DLL's become fatter and slower and I get bad data where as they work using 3.0.4. It just so happens that I do have some operations INLINED like this using strings and static type arrays and with the errors I am getting it kind of points to what you found. Thank You. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-08-01 19:47 | Frederic | New Issue | |
2020-08-01 19:47 | Frederic | File Added: example.pas | |
2020-08-01 21:02 | jamie philbrook | Note Added: 0124471 | |
2020-08-23 13:28 | Jonas Maebe | Assigned To | => Jonas Maebe |
2020-08-23 13:28 | Jonas Maebe | Status | new => resolved |
2020-08-23 13:28 | Jonas Maebe | Resolution | open => fixed |
2020-08-23 13:28 | Jonas Maebe | Fixed in Version | => 3.3.1 |
2020-08-23 13:28 | Jonas Maebe | Fixed in Revision | => 37465 |
2020-08-23 13:28 | Jonas Maebe | FPCTarget | => 3.2.2 |