Browse Source

+ also set the operand size in constants like recordtype (without addressing a
record field). This makes e.g.
test [di + recordtype], 1
work and use the size of recordtype to determine the operand size; recordtype
itself is evaluated to 0, so if recordtype's size is 2 bytes, the above
instruction assembles as:
test word ptr [di], 1
Ugly, but TP7 compatible.

git-svn-id: trunk@38176 -

nickysn 7 years ago
parent
commit
f0765421eb
1 changed files with 1 additions and 0 deletions
  1. 1 0
      compiler/x86/rax86int.pas

+ 1 - 0
compiler/x86/rax86int.pas

@@ -1083,6 +1083,7 @@ Unit Rax86int;
                              begin
                              begin
                                if not(ttypesym(sym).typedef.typ in [recorddef,objectdef]) then
                                if not(ttypesym(sym).typedef.typ in [recorddef,objectdef]) then
                                 Message(asmr_e_wrong_sym_type);
                                 Message(asmr_e_wrong_sym_type);
+                               size:=ttypesym(sym).typedef.size;
                              end;
                              end;
                            fieldvarsym :
                            fieldvarsym :
                              begin
                              begin