#2123 z80: SIGSEGV - initializing pointer in structure

closed-fixed
Ben Shi
None
Front-end
5
2015-02-11
2013-01-04
mz-fuzzy
No

This code produces SIGSEGV:
--------------------
struct {char *a; char *b;} v[1] = { { (v->b) } };
--------------------

when compiling with
sdcc -mz80 -c <file.c>

SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.1 #8331 (Jan 4 2013) (Linux)

Discussion

  • mz-fuzzy

    mz-fuzzy - 2013-01-04

    ... or a more meaningful version:
    struct {char *a; char b[8];} v[1] = { { v->b } };

    the semantics is that I want to initialize a to point to b array.

     
  • Ben Shi

    Ben Shi - 2015-02-11

    Fixed in reversion #9179.

     
  • Ben Shi

    Ben Shi - 2015-02-11
    • labels: z80 port -->
    • status: open --> closed-fixed
    • assigned_to: Ben Shi
    • Category: --> Front-end
     

Log in to post a comment.