Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
Delphi
Anonymous Methods
BASM
Code Generation/Optimization
Error Recovery
Errors - Warnings
Exceptions
Execution
Finalization
Generics
Header Generation
Interaction with UI
Interfaces
Language
Linker
Make Logic
Memory Manager
OBJ Generation
OBJ Support
Other Compiler
Packages
RTTI
String Resources
TD Debug Info
Thread Local Storage
Version resilience
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/Delphi/BASM
[ Add a report in this area ]
Report #:
87994
Status:
Open
SizeOf evaluated incorrectly in assembly expressions
Project:
Delphi
Build #:
15.0.3890.34076
Version:
15.0
Submitted By:
Philipp S
Report Type:
Basic functionality failure
Date Reported:
9/12/2010 10:57:40 AM
Severity:
Infrequently encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
280439
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
4.00 out of 5
Total Votes:
15
Description
The use of SizeOf(Type) is seemingly valid in BASM. However, SizeOf(Type) does not appear to be evaluated correctly in BASM.
Note: this seems to be the case for at least Delphi XE, D2010, D2009 and D2006.
Steps to Reproduce:
Inspect the code generated for the following routine:
Expected: all three statements produce the same code
Observed: those statements containing SizeOf(..) do not produce correct code
procedure Bug_Asm_SizeOf;
type
TByteSet = set of byte;
const
SzByteSet = SizeOf (TByteSet); // = 256/8 = 32 bytes = $20 bytes
asm
mov eax, longword(SizeOf(TByteSet)) //<<< WRONG
// B831000000 mov eax,$00000031
mov eax, dword ptr SizeOf(TByteSet) //<<< WRONG
// B831000000 mov eax,$00000031
mov eax, SzByteSet //<<< correct
// B820000000 mov eax,$00000020
end;
Workarounds
None
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us