Changeset 25280

Timestamp:
Apr 16, 2021, 6:49:18 PM (3 years ago)
Author:
wraitii
Message:

Set a stack quota for JS scripts to prevent crashes from infinite loops.

Infinite loop will instead trigger JS exceptions, which will make error reports much nicer.

Differential Revision: https://code.wildfiregames.com/D3851

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/scriptinterface/ScriptContext.cpp

    r24915 r25280  
    2020#include "ScriptContext.h"
    2121
     22
    2223#include "ps/GameSetup/Config.h"
    2324#include "ps/Profile.h"
     
    9293    m_cx = JS_NewContext(contextSize);
    9394    ENSURE(m_cx); // TODO: error handling
     95
     96
     97
     98
     99
     100
     101
     102
     103
    94104
    95105    ENSURE(JS::InitSelfHostedCode(m_cx));
Note: See TracChangeset for help on using the changeset viewer.