-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where recursion depth is not reset on longjmp
- Loading branch information
1 parent
2a8de0f
commit fe0f45e
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
gap> START_TEST("depth.tst"); | ||
|
||
# We don't know what the recursion depth will be when the test starts, | ||
# so do relative comparisons. | ||
gap> curdepth := GetRecursionDepth();; | ||
gap> GetRecursionDepth() - curdepth; | ||
0 | ||
gap> dive := function(depth) | ||
> if depth>1 then | ||
> dive(depth-1); | ||
> else | ||
> Print("Depth ", GetRecursionDepth() - curdepth, "\n"); | ||
> fi; | ||
> end;; | ||
gap> dive(10); | ||
Depth 10 | ||
gap> dive(80); | ||
Depth 80 | ||
gap> SetRecursionTrapInterval(50); | ||
gap> dive(80); | ||
Error, recursion depth trap (50) | ||
gap> SetRecursionTrapInterval(5000); | ||
gap> dive(80); | ||
Depth 80 | ||
|
||
# Just want an error to occur to check the depth is reset correctly | ||
gap> IsAbelian(2); | ||
Error, no method found! For debugging hints type ?Recovery from NoMethodFound | ||
Error, no 1st choice method found for `IsCommutative' on 1 arguments | ||
gap> dive(80); | ||
Depth 80 | ||
gap> STOP_TEST( "depth.tst", 1); |