-
Notifications
You must be signed in to change notification settings - Fork 120
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
System.NotSupportedException: 'Illegal one-byte branch at position: 233. Requested branch was: 204.' #86
Comments
This problem has been solved. Change this code error code with solved code. |
I wonder if this could be the same reason IIS is crashing for some people on 64 bit. |
I reproduced this on .Net Framework 4.7.2 without the AND function: I believe the problem is in I'm working on it to see if I can find a fix. |
Turns out this is messier than I hoped. However, the problem is definitely similar to what I described: nested long branches. Nested conditionals don't generate their correct length until the final time they are compiled. In order to detect long branches, Flee generates the IL in a temporary mode, will all short branches. But as it breaks the code down it doesn't gather ALL the branches into one array and test them, it on tests at the top of the current level. The offsets are wrong because if there is a long branch inside a conditional expression (a conditional in a conditional in a conditional....) it doesn't do the adjustment for the branches until the 2nd time through, but that time the top level expects the size to be the same, but it isn't so the long branch detection fails. I have implemented a fix, but it involves outputting NOP in the temp mode generation. This reduces the work of generating code at the lower levels over what exists in the current repo, but it could be better. Another approach which would track all branches from the very top level, and then fix up all branches and compile only twice the entire expression. Currently, nested expressions can be compiled more than twice. However, since ComputeBranches is only suited for 2 branches, this would require a lot more work and a lot more structural changes maintain a single list of branches. (I think ComputeBranches could work if the branches were sorted in reverse order by start location) My patch is available in this repo: https://github.com/hunkydoryrepair/Flee I can submit a pull request unless somebody wants to invest into a better solution. |
I use .NET Core 2.0 and this is the code:
The exception throw
I just changed
2
to2.1
and it doesn't work. How to solve this?The text was updated successfully, but these errors were encountered: