voc icon indicating copy to clipboard operation
voc copied to clipboard

Compiler segment fault when compiling assignment of dynamic array to static array.

Open dcwbrown opened this issue 8 years ago • 0 comments

Reported by Артур Ефимов.

    On 2017-01-17 12:34, Артур Ефимов wrote:

        Hi Dave,

        I've just found another bug. It's a new one, as I've been getting a segmentation fault trying
        to recompile a module that has worked with the older version of voc. I managed to narrow 
        it down to a small module:

        MODULE StringBug;
        VAR s: POINTER TO ARRAY OF CHAR;
            s2: ARRAY 32 OF CHAR;
        BEGIN
          s2 := s^
        END StringBug.
         
        I know this is an incorrect program, but it produces a segmentation fault upon compilation, 
        not in runtime. I've tested it on Debian 32 bit.

        Here is what "gdb --args voc StringBug.Mod" outputs:
        Starting program: /opt/voc/bin/voc StringBug.Mod
        Program received signal SIGSEGV, Segmentation fault.
        0x08069e5e in OPC_CompleteIdent (obj=0x0) at OPC.c:1656
        1656        level = obj->mnolev;

        Arthur

dcwbrown avatar Jan 19 '17 12:01 dcwbrown