Skip to content

Commit

Permalink
Fix a regression for the fiber depth computation introduced by the ch…
Browse files Browse the repository at this point in the history
…ange on 1/19/24, 5:35PM
  • Loading branch information
Gene Gleyzer committed Feb 9, 2024
1 parent 7715772 commit 606d77d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions javatools/src/main/java/org/xvm/runtime/Fiber.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public Fiber(ServiceContext context, Message msgCall)
f_fnCaller = msgCall.f_fnCaller;
m_status = FiberStatus.Initial;

if (fiberCaller == null)
if (fiberCaller == null || fiberCaller.getStatus() == FiberStatus.Terminating)
{
// an independent fiber is only limited by the timeout of the parent service
// and in general has no timeout
// an independent or asynchronous (e.g. created by "callLater") fiber is only limited
// by the timeout of the parent service and in general has no timeout
f_nDepth = 0;
}
else
Expand Down
2 changes: 1 addition & 1 deletion javatools/src/main/java/org/xvm/runtime/Frame.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected Frame(Fiber fiber, int iCallerPC, Op[] aopNative,
f_context = fiber.f_context;
f_iId = f_context.m_iFrameCounter++;
f_nDepth = fiber.f_nDepth; // under-count, but works to prevent an infinite recursion
f_fiber = fiber;
f_fiber = fiber;
f_framePrev = null;
f_iPCPrev = iCallerPC;
f_function = null;
Expand Down

0 comments on commit 606d77d

Please sign in to comment.