-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uninterruptible loop #2256
Comments
Why would we want t_empty to be non-interuptable? I would think we'd want as much to be interupttable as reasonable? |
Well,
As you can see, in the break loop, we try to print the statement that was interrupted. Which makes a lot of sense for single statements like Now consider what happens for a
It prints out the empty statement, which is not very helpful. If instead the loop code handled the interrupt (and I don't mean making The reason I don't like making All of that said, for the bug at hand, I think the quickest solution would be to just move all of START_ENUM_RANGE(FIRST_CONTROL_FLOW_STAT),
T_BREAK,
T_CONTINUE,
T_RETURN_OBJ,
T_RETURN_VOID,
END_ENUM_RANGE(LAST_CONTROL_FLOW_STAT), out of the |
This looks correct to me. I think you do want any interrupt to be associated with a statement which is actually present in the source code, rather than a filler or compounds of such. None of those statements should ever take significant time, so the only reason you might need to interrupt one of them is if you have a loop or recursion with no other interruptible statement in it, but that can basically never be useful, so let's avoid doing it. |
This code snippet cannot be interrupted with ctrl-c:
This is present in master but also in GAP 4.8 and older. The problem also affects
for
loops andwhile
loops.One way to fix this would be to move
T_CONTINUE
out of theFIRST_NON_INTERRUPT_STAT .. LAST_NON_INTERRUPT_STAT
range. Another would be to leave it in there, but add additional interrupt checks to all loop constructs. If we do that, we could then also moveT_EMPTY
into the range of non-interruptible stats.The text was updated successfully, but these errors were encountered: