#151 Compiler crash: x=*a[10]

closed-fixed
nobody
None
5
2013-05-25
2001-09-28
No

The following code crashes the compiler:

extern void f( int x );
void main( const char* array[] )
{
char p = *array[10];
f(p);
}

tested with RC2, and september 27 snapshot, both fail.
Flags: -mz80 -c

SDCC caused an invalid page fault in
module SDCC.EXE at 015f:0042ce67.
Registers:
EAX=00000000 CS=015f EIP=0042ce67 EFLGS=00010246
EBX=02749c20 SS=0167 ESP=0260c4d0 EBP=0260c4f8
ECX=02748d90 DS=0167 ESI=0260c570 FS=3447
EDX=00000001 ES=0167 EDI=02748d20 GS=0000
Bytes at CS:EIP:
8a 40 14 c0 e8 02 89 c3 8b 06 83 e3 01 83 c4 f4
Stack dump:
02748d20 0000000c 0260c518 0042dd67 02749c20 00000000
0260c538 0042dca0 027472f0 02748080 0260c528 00429333
02749c40 0260c538 02748d90 0042f417

Discussion

  • Marc Nijweide

    Marc Nijweide - 2001-09-28

    Logged In: YES
    user_id=262367

    This may be related:
    The september 27 snapshot generates an error
    on the following code:

    extern void f( int x );
    void main( char* array[] )
    {
    char *p = array[10]; /* ERROR */
    f( *p );
    }

    error *** non-pointer type case to generic pointer.

     
  • Johan Knol

    Johan Knol - 2001-09-30

    Logged In: YES
    user_id=63512

    fixed in SDCCicode.c:1.88

    You followup was indeed related and helped me to fix it.

     
  • Johan Knol

    Johan Knol - 2001-09-30
    • milestone: --> fixed
    • status: open --> closed-fixed
     

Log in to post a comment.