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

FunC does not throw on 1024 bits long slice constant creation with s literal #1153

Open
Gusarich opened this issue Sep 5, 2024 · 0 comments

Comments

@Gusarich
Copy link

Gusarich commented Sep 5, 2024

Code:

const slice s = "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"s;

() main () {
    ~dump(s);
}

This slice constant is 256 digits long (1024 bits).

Current Behavior

FunC successfully compiles into:

"Asm.fif" include
PROGRAM{
  DECLPROC main
  main PROC:<{
    x{abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd} PUSHSLICE
    s0 DUMP
    DROP
  }>
}END>c

Which throws an error when running:

libc++abi: terminating due to uncaught exception of type vm::CellBuilder::CellCreateError

Expected Behavior

FunC should have thrown a compilation error due to the string being too long.

@Gusarich Gusarich changed the title FunC does not throw on 1024 bits long slice constant creation FunC does not throw on 1024 bits long slice constant creation with s literal Sep 5, 2024
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