Closed dzonerzy closed 2 years ago
The error happen at:
duk_bool_t val = duk_get_boolean(ctx, -1);
basically here i'm checking the result of the callback (the one which receive each process object) it it's true i want to exit without looping all the other processes , that's works fine until the right process is matched, so i think I've messed up something inside the symbols loop
Is the value stack intended to grow significantly in the C code dealing with the arguments? If so, you may need to extend the value stack manually, see https://duktape.org/guide.html#programming.5.
If the value stack is intended to remain small, then typically some loop is not popping all temporaries and accidentally allows the value stack to grow. One can detect this situation usually fairly easily by debug printing duk_get_top()
at the top of each loop. The fix is either to find the missing pop(s), or the rework the loop so that one explicitly resets the top to a known value e.g. at the top of the loop to automatically pop any temporaries from the previous round.
I'm trying to bind a C function to duktape , this function should return an object containing each processes with their loaded modules and each exported function for each module, here's the main C code:
and this is the JS code i'm trying to run: