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

add bound checking in pargs #170

Open
alxest opened this issue Oct 17, 2021 · 1 comment
Open

add bound checking in pargs #170

alxest opened this issue Oct 17, 2021 · 1 comment
Labels

Comments

@alxest
Copy link
Collaborator

alxest commented Oct 17, 2021

No description provided.

@dongjaelee1
Copy link
Collaborator

dongjaelee1 commented Dec 29, 2021

This is regarding the overflow of int(also perhaps ptroffs) type.
Currently, Imp only imposes intrange_64 condition on int for only certain cases (comparison, system call arguments).
For memory offset, load/store(by Imp), alloc(by Mem).
For CompCert compilation, overflow is handled by performing modular arithmetics. Therefore, there are some valid programs in Imp, but executes UB if intrange_64 is checked upon pargs(as @alxest mentioned).

f (x: int) { return x + 1; }
main () {a = f(INTMAX + 1); print(a); }

What we want is to erase all the overflow checks (extra assume (intrange_64))s) from 0-level specs(MutF0.v).
Some possible solutions:

  • Have two types: Tint: checks overflow, Tz: does not.
  • Include intrange_64 condition in Tint type, following CompCert.
    The second one needs more work, including fixing the compiler.

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

No branches or pull requests

2 participants