kallemooo / Asap2

Asap2 parser.
MIT License
38 stars 21 forks source link

software crash for RECORD_LAYOUT #7

Closed xujinpeng1117 closed 2 years ago

xujinpeng1117 commented 4 years ago

Hi:

Thanks for you lib!

I found software crash when a2l include following txt: /begin RECORD_LAYOUT SWORD_COL_DIRECT FNC_VALUES 1 SWORD COLUMN_DIR DIRECT ALIGNMENT_WORD 2 ALIGNMENT_LONG 2 ALIGNMENT_FLOAT32_IEEE 2 ALIGNMENT_FLOAT64_IEEE 4 /end RECORD_LAYOUT

It seems the problem come from Asap2Files.cs line 816 [Element(1, IsDictionary = true)] public Dictionary<string, ALIGNMENT> alignments; So I change it to : [Element(1, IsDictionary = true)] public Dictionary<string, ALIGNMENT> alignments = new Dictionary<string, ALIGNMENT>();

The software can work normally now. Is my modification correct?

kallemooo commented 2 years ago

Yes.

That is correct fix.