Kipt / BEdit

Issues and documentation for BEdit
6 stars 0 forks source link

[Bug] Assertion failed: arrayIndex < targetArray->arrayCount, file d:\programmering\bedit_pub\BEdit.c, line 5123 #49

Closed Benjipede closed 3 years ago

Benjipede commented 3 years ago

The following layout file triggers the assert in the issue title as long as the data file is long enough. Having a struct field after a struct field ending in an array with two or more elements triggers the assert, it seems. The length and type of scalar fields does not seem to matter.

Layout file:

struct Bottom0
{
    string(1) data[2]; // array length of 2 or greater triggers the BEAssert.
    // string(1) a; // It has to end with the array.
};

struct Bottom1
{
    string(4) a;
};

struct Top
{
    Bottom0 first;
    // string(1) a; // This is fine, however, the next line still triggers the BEAssert.
    Bottom1 second; // If this is made into an array, it works.
};

layout Top;

Data file: abcdefghijklmnopqrstuvwxyz0123456789

Kipt commented 3 years ago

Thank you for reporting this issue. I will make sure a fix for this is in the next release.

Kipt commented 3 years ago

This is now fixed for incoming release. If you want to use the command line version from source before that, build from commit 2f5e7b7 or later.

I'll close this ticket after next version has been released.

Kipt commented 3 years ago

Implemented for version 0.2.1