Henri Biestro created JEXL-274:
----------------------------------

             Summary: Handle soft and hard stack overflow
                 Key: JEXL-274
                 URL: https://issues.apache.org/jira/browse/JEXL-274
             Project: Commons JEXL
          Issue Type: Improvement
    Affects Versions: 3.1
            Reporter: Henri Biestro
            Assignee: Henri Biestro
             Fix For: 3.2


WHAT:
Since JEXL allows recursion, it would be convenient to stop execution early 
when running towards a stack overflow. In general, scripts don't have much use 
for recursion so this would be a good (soft) safeguard.
Incidentally, when a function called by a script ends up in a stack overflow, 
it would be nice to catch it and properly propagate it through a JexlException.
HOW:
Introduce a new JexlException subclass (StackOverflow) that can be thrown after 
catching a (JVM) StackOverflow in Interpreter.interpret().
The StackOverflow soft limit -ie one that pertains to JEXL only - requires a 
new JexlBuilder option (stackOverflow(size)) and a way to count the stack 
'height'; easiest/safest seems to put interpreter instance in TLS and 
increment/check a 'frame pointer' member.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to