binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Are there any limits on nested blocks/loops in binaryen ?

Open hgruniaux opened this issue 1 year ago • 2 comments

The question is in the title.

I searched in the code, and I found nothing. I am curious to know if there are any limits in the parser or the static analyzer for the depth of nested blocks or loops.

Also, do you know if such limits exist in current engines?

Thanks in advance.

hgruniaux avatar Aug 10 '24 10:08 hgruniaux

I don't believe there is a specific limit for such nesting. Here is the V8 file with such limits:

https://github.com/v8/v8/blob/main/src/wasm/wasm-limits.h

I don't recall this being an issue in the past, either in V8 or Binaryen or elsewhere. It is common to have many thousands of nested blocks in practice for various switch constructs, for example.

kripken avatar Aug 12 '24 19:08 kripken

Thanks for your answer!

hgruniaux avatar Aug 13 '24 13:08 hgruniaux