Closed moznion closed 9 years ago
Thanks for reporting. But this behavior is not a specification. Therefore, It do not need to switch by options.
Simply, what about the following code ?
+ static const int EXTEND_BUFFER_SIZE = 16; // this parameter is needed to correspond #53
- script_size = strlen(script) + 1;
+ script_size = strlen(script) + 1 + EXTEND_BUFFER_SIZE;
Well, how do we deal with this problem if memory size is shorter than hard-coded EXTEND_BUFFER_SIZE
?
I modified the above code and created PR #56. Please review this code > @moznion
Well, how do we deal with this problem if memory size is shorter than hard-coded EXTEND_BUFFER_SIZE?
Is it problem ?
Yes, if target code occupies memory which overs the maximum size then we cannot handle it.
Example for the above case;
s///;s///;s///;s///;s///;s///;s///;s///;s///;s///;
If this code is evaluated, it will occur SEGV. This is silly case, but we cannot handle it indeed.
So I wish to configure the size of extended memory.
If will support the above code, it must check buffer size enough or not for each tokens. If there is a need, I will support. This feature should not be supported as option.
Okay, I understood. There is a necessity, I think.
I've closed this pull request. Please apply #56.
ref: #53