• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Delphi 4 bug?

Why my open, save and compile doesn't work and sometimes work. I patched my delphi 4 to 4.01, i still get the weird message when i exit delphi. Do i need the patch delphi 4.01 to 4.02.
1 Solution
mhietaAuthor Commented:
Edited text of question
What message?
mhietaAuthor Commented:
Runtime error 216

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I haven't encountered this bug but the only way you can deal with any bugs in delphi is having the most updated version. That is downloading any service pack for Delphi released by Borland
Try it
Area: compiler\delphi\code generation\optimization
You need to upgrade to SP2.  See fixes document below.

Reference Number: 473 (Published: 10/28/98)

Status: Fixed in Version 4 Update Pack 2
Date Reported: 8/18/98

Severity: Commonly Encountered

Type: Crash


The Delphi 3.02 linker is a bit too clever when
removing symbols.

It also has a severe code generation bug (the
compiler may be involved
too - I just don't care, since the net effect is the

In a nutshell, if one tries to FLD (BASM) data that
has been declared
using the absolute directive, then bad code is
generated. This will
make the application crash at runtime with access

You will get an access violation (in this case a
Runtime Error 216,
otherwise an exception EAccessViolation) on
execution of

    fld test1

This is because the first few lines of assembler code
look like this

  fld test1
0052768C:  DD0502504A30 FLD QWORD PTR

  fld test2

00527692:  DD0500528884 FLD QWORD PTR

[my applications are always based at $500000]

First result:
  Clearly [+02504A30] looks a bit like garbage (and
it is plain
  wrong, of course)... This explains the crash, since
  is way beyond reach for this application.

Second result:
   Run the code as shown above up to the first FLD
   or single-step).

   Have tooltip expression or "Evaluate" tell you
      test1  -- > "Symbol was eliminated by linker"

"Touching" the Constant variable, e.g. Constant[1]
:= 0;, does
apparently make the linker sort of include "test1",
but does _NOT_
remove the crash (!).

Even worse, touching the Test1 variable, e.g.
Test1 := 0;, does not
change this behaviour, either.

The only solution to this problem is to have the
absolute declaration
turned around, e.g.

  Test3: double = 0;
  Constant2: array[1..8] of byte absolute Test3;

Found on the delphi.basm newsgroup:

unit TestMe;



  Constant: array[1..8] of byte;

  Test1: double absolute Constant;
  Test2: double = 0;

procedure RunMe;
  fld test1
  fld test2

  fstp st(0)
  fstp st(0)




mhietaAuthor Commented:
Thanks to Llysander and all of you by answered to my question.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now