This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new 546662883 debugger: avoid ArrayIndexOutOfBoundsException when 
evaluating expression and generated FileNode contains no children (references 
BowlerHatLLC/vscode-swf-debug#47)
546662883 is described below

commit 5466628831d260a98d7471e85e23baa52e293a56
Author: Josh Tynjala <[email protected]>
AuthorDate: Wed Jul 5 14:49:00 2023 -0700

    debugger: avoid ArrayIndexOutOfBoundsException when evaluating expression 
and generated FileNode contains no children (references 
BowlerHatLLC/vscode-swf-debug#47)
---
 .../src/main/java/flash/tools/debugger/expression/DebuggerUtil.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/debugger/src/main/java/flash/tools/debugger/expression/DebuggerUtil.java 
b/debugger/src/main/java/flash/tools/debugger/expression/DebuggerUtil.java
index 319ba4317..ddd4aa3db 100644
--- a/debugger/src/main/java/flash/tools/debugger/expression/DebuggerUtil.java
+++ b/debugger/src/main/java/flash/tools/debugger/expression/DebuggerUtil.java
@@ -66,6 +66,10 @@ public class DebuggerUtil
         scopedNode.setScope(new ASFileScope(workspace, "fake"));
         
scopedNode.runPostProcess(EnumSet.of(PostProcessStep.CALCULATE_OFFSETS));
 
+        if (exprAST.getChildCount() == 0) {
+            return exprAST;
+        }
+
         // return the first (and only child).  This is essentially unwrapping 
the
         // FileNode that was wrapped around the expression being parsed
         return exprAST.getChild(0);

Reply via email to