Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3d: more meaningful error messages for misuses of [:consume-all] #133

Open
tahina-pro opened this issue Mar 12, 2024 · 0 comments
Open

3d: more meaningful error messages for misuses of [:consume-all] #133

tahina-pro opened this issue Mar 12, 2024 · 0 comments

Comments

@tahina-pro
Copy link
Member

Reported by @Smfakhoury

The following 3D specification:

typedef struct _s {
UINT8 a[:consume-all];
UINT8 b[:consume-all];
} s;

rightfully fails because [:consume-all] removes the strong prefix property of its parser. But right now, EverParse fails with F* Error 19, i.e. a Z3 failure to prove that field a above with [:consume-all] has the strong prefix property. While expected, this is not palatable to the user.

In fact, as designed in #116, [:consume-all] is meant to be used only as the last field of a struct. Thus, I believe this should be checked syntactically (or, at worst, at the level of the 3D AST) and EverParse should reject uses of [:consume-all] for struct fields other than the last one, with a suitable error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant