View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023962 | FPC | Compiler | public | 2013-02-26 16:29 | 2014-03-04 17:54 |
Reporter | Reimar Grabowski | Assigned To | Jonas Maebe | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | x86_64 | OS | Ubuntu | ||
Product Version | 2.7.1 | ||||
Fixed in Version | 2.6.4 | ||||
Summary | 0023962: When passing a packed record to a overridden, virtual method the method argument contains incorrect values | ||||
Description | When overriding a virtual method which takes a packed record as argument and compiling the program either with -Cr or -CR the record contains incorrect values inside the method. | ||||
Steps To Reproduce | program argumentbug; {$MODE ObjFpc} uses classes; type TVector3 = packed record X, Y, Z: Single; end; TClassA = class protected fVector: TVector3; public procedure SetVector(AVector: TVector3); virtual; abstract; end; { TClassB } TClassB = class(TClassA) public procedure SetVector(AVector: TVector3); override; end; { TClassB } procedure TClassB.SetVector(AVector: TVector3); begin writeln('TClassB: ',AVector.X,',',AVector.Y,',',AVector.Z); fVector:=AVector; end; var MyVector: TVector3; MyClassB: TClassB; begin MyVector.X:=0; MyVector.Y:=0; MyVector.Z:=3; MyClassB:=TClassB.Create; MyClassB.SetVector(MyVector); end. Compile with either -Cr or -CR and run. Output: TClassB: 0.000000000E+00, 3.000000000E+00, 3.000000000E+00 Expected output: TClassB: 0.000000000E+00, 0.000000000E+00, 3.000000000E+00 | ||||
Additional Information | Although the method in the example code is abstract the problem stays even if the method is not abstract and only virtual. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 25917 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2013-02-26 16:29 | Reimar Grabowski | New Issue | |
2013-03-06 13:43 | Jonas Maebe | Fixed in Revision | => 23700 |
2013-03-06 13:43 | Jonas Maebe | Status | new => resolved |
2013-03-06 13:43 | Jonas Maebe | Fixed in Version | => 2.7.1 |
2013-03-06 13:43 | Jonas Maebe | Resolution | open => fixed |
2013-03-06 13:43 | Jonas Maebe | Assigned To | => Jonas Maebe |
2013-11-03 15:31 | Jonas Maebe | Fixed in Revision | 23700 => 25917 |
2013-11-03 15:31 | Jonas Maebe | Fixed in Version | 2.7.1 => 2.6.3 |
2014-03-04 17:54 | Jonas Maebe | Fixed in Version | 2.6.3 => 2.6.4 |