Isolate part of the memory to be used only by specific code in C++ -


The story below is what I am playing with, in which there is an excellent syntax for defining grid grammar and using it Very easy. I was completely happy with it until I found mysterious segfaults with the parser generated. Some research has detected the problem in one of the Helper functions generated:

  YY_LOCAL (zero) yySet (Yycontext * yy, char * text, int count) {yy-> __val [count] = yy- & gt; __; }  

This function always count & lt; 0 is the use of negative indices on the array array is called undefined behavior. As I think that the megars are allotted to the peg / leg, which gives the correct indicator in another array, pointing backward from the array. This is actually a very bad code, but it works well most of the time. However, in some other parts of my program, some allocation memory blocks and everything emphasizes forces at different places for the segment.

I doubt that the use of peg / leg due to this problem is malolk and my program uses new one, but I can not change my code to use Malok and fix peg / leg Can not be done (it's complex and unclear).

In this way I need to separate the memory, which is used by the parser from the rest of my program to avoid any interference.

Is there a way to do this in C ++? Is there any possibility of placing the parser code in the "sandbox"?


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -