Board index » delphi » Invalid floating point exception

Invalid floating point exception

I'm porting an application from C to CBuilder Professional, version 5.0, update pack 1.  The application has been running fine for several months, but now I'm trying to parse a new file, and the program crashes with a pop-up Error box.  The relevant lines of code from a .c file:

        fptr = &PDATA->XFF[i];
        PDATA->XF[i] = *fptr + .5;
        PDATA->XFF[i] = PDATA->XF[i];    /* put in exact machine coordinates */

On the second line, the crash occurs.  I've tried setting a breakpoint and looking at the CPU window; the assembler window shows:

 move edx,[ebp-0x08]
 fld dword ptr [edx]

The crash is on the second assembler instruction.  The edx register contains 4509DC; when I display that address, its contents are 4A349BF0, or 2959100 in floating point.  The processor simply refuses to load data from that address, though, and I'm stumped.  Similar code is working OK elsewhere in the application.

I'm running Windows 98 on a Compaq notebook.


Re:Invalid floating point exception

More people familar with the product will see your message if you post in a
newsgroup where that product is covered.  You are using C++ Builder but have
posted in a newsgroup where the Borland C++ compiler is covered.  Look for
newsgroups with the word 'cppbuilder' in the
name and post there.  For instance:


.  Ed

Other Threads