There is always a stack limit, which always prevents infinite recursion; as
well as, in fact, finite but very deep recursion.
As Ben said, the only way to prevent infinite or long-running loops is by
interrupting the program from another thread. You may have heard of
the *Halting
Problem*, TL;DR:
I don't think there's any way. V8 JavaScript code is compiled to native
code, and no instrumentation is really possible on that.
On Sunday, November 20, 2016 at 10:18:24 AM UTC-8, James Lovejoy wrote:
>
> Really I need something a little more deterministic than a time limit. Is
> there a way to
Really I need something a little more deterministic than a time limit. Is
there a way to set an instruction limit? Or perhaps something similar to
lua_sethook (http://pgl.yoyo.org/luai/i/lua_sethook) in Lua which calls a
callback every given number of instructions.
On Sun, Nov 20, 2016 at 4:02
On Sat, Nov 19, 2016 at 10:11 PM, James Lovejoy wrote:
> Hi,
>
> Is there a way to set a hard execution limit in the V8 engine? I want to be
> able to prevent things like infinite loops and recursions. I realise that
> since V8 compiles to machine code I don't get a
Hi,
Is there a way to set a hard execution limit in the V8 engine? I want to be
able to prevent things like infinite loops and recursions. I realise that
since V8 compiles to machine code I don't get a program counter or
anything. I feel like setting the "stack limit" is the right way to go