tw16163.pp 611 B

123456789101112131415161718192021222324252627282930313233343536
  1. { %norun }
  2. program test;
  3. {$mode objfpc}
  4. type
  5. TFColor = record
  6. b, g, r : Byte;
  7. // m : Byte; // uncomment it to avoid InternalError 200301231
  8. end;
  9. TFColorA = record
  10. c : TFColor;
  11. a : Byte;
  12. // adding some field here, or chaning a type to Word or Interger
  13. // also fixed the problem.
  14. end;
  15. function FColorToFColorA(C : TFColor) : TFColorA;
  16. begin
  17. Result.c:=C;
  18. Result.a:=255;
  19. end;
  20. var
  21. t : TFColor;
  22. a : TFColor;
  23. begin
  24. FillChar(a, sizeof(a), $55);
  25. t:=FColorToFColorA(a).c; // IE 200301231 why?
  26. if (t.b<>$55) or
  27. (t.r<>$55) or
  28. (t.g<>$55) then
  29. halt(1);
  30. end.