poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unhandled invalid element exception


From: Jose E. Marchesi
Subject: Re: unhandled invalid element exception
Date: Sun, 07 Jun 2020 20:11:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

        
        I'm getting an "unhandled invalid element exception" when I use a 
reference
        to a conditional, nested struct field as an array bounds.
        
        Test case:
        
        $ poke
        .load gmo.pk
        .file de.mo
        gmo @ 0#B
        unhandled invalid element exception
        
        The problem is in line 116 of gmo.pk. If I comment it out and use line 
115
        instead, I don't get this exception (but then the array size is not the 
one
        I really want).
        
        It is strange that I get this exception at run time. If there was 
something
        wrong with my pickle, I would have expected an error at load time.
        
    The problem is that header.rev1 is an optional field, and you are
    getting the run-time exception because apparently it doesn't exist in
    `header', i.e. minor_revision < 1.
    
    There seems to be some integrity problem with your data.  Maybe
    sysdep_segments should be optional itself, based on header.revision?

Oh, I now realize you have that covered:

    struct
    {
      /* Table describing system dependent segments.  */
      gmo_le_sysdep_segment[header.rev1.n_sysdep_segments] sysdep_segments; // 
ERROR "unhandled invalid element exception" at run time
    } if ((header.revision & 0xffff) >= 1);

I'm taking a look.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]