Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doc/ref/debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ Error, recursion depth trap (5000)
[2] dive( depth - 1 );
@ *stdin*:1
... at *stdin*:4
you may 'return;'
you can 'return;'
brk> return;
gap> dive(11000);
Error, recursion depth trap (5000)
Expand All @@ -932,15 +932,15 @@ Error, recursion depth trap (5000)
[2] dive( depth - 1 );
@ *stdin*:1
... at *stdin*:5
you may 'return;'
you can 'return;'
brk> return;
Error, recursion depth trap (10000)
*[1] dive( depth - 1 );
@ *stdin*:1
[2] dive( depth - 1 );
@ *stdin*:1
... at *stdin*:5
you may 'return;'
you can 'return;'
brk> return;gap>
]]></Log>
<P/>
Expand Down Expand Up @@ -981,15 +981,15 @@ Error, recursion depth trap (1000)
[2] dive( depth - 1 );
@ *stdin*:4
... at *stdin*:12
you may 'return;'
you can 'return;'
brk> return;
Error, recursion depth trap (2000)
*[1] dive( depth - 1 );
@ *stdin*:4
[2] dive( depth - 1 );
@ *stdin*:4
... at *stdin*:12
you may 'return;'
you can 'return;'
brk> GetRecursionDepth();
0
brk> return;
Expand Down
2 changes: 1 addition & 1 deletion src/cyclotom.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ static UInt FindCommonField(UInt nl, UInt nr, UInt *ml, UInt *mr)
"This computation requires a cyclotomic field of degree %d, larger "
"than the current limit of %d",
n, (Int)CyclotomicsLimit,
"You may return after raising the limit with SetCyclotomicsLimit");
"you can 'return;' after raising the limit with SetCyclotomicsLimit");
}

// Finish up
Expand Down
15 changes: 9 additions & 6 deletions src/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,13 @@ Obj ErrorReturnObj(const Char * msg, Int arg1, Int arg2, const Char * msg2)
*/
void ErrorReturnVoid(const Char * msg, Int arg1, Int arg2, const Char * msg2)
{
Obj LateMsg;
LateMsg = MakeString(msg2);
CallErrorInner(msg, arg1, arg2, 0, 1, 0, LateMsg);
// ErrorMode( msg, arg1, arg2, (Obj)0, msg2, 'x' );
if (msg2 == 0) {
msg2 = "you can 'return;' to continue";
}

Obj lateMsg = MakeString("you can 'quit;' to quit to outer loop, or\n");
AppendString(lateMsg, MakeString(msg2));
CallErrorInner(msg, arg1, arg2, 0, 1, 0, lateMsg);
}

/****************************************************************************
Expand Down Expand Up @@ -648,7 +651,7 @@ void ErrorBoundedInt(

void AssertionFailure(void)
{
ErrorReturnVoid("Assertion failure", 0, 0, "you may 'return;'");
ErrorReturnVoid("Assertion failure", 0, 0, 0);
}

void AssertionFailureWithMessage(Obj message)
Expand All @@ -659,7 +662,7 @@ void AssertionFailureWithMessage(Obj message)
AssertionFailure();
}
else if (IS_STRING_REP(message)) {
ErrorReturnVoid("Assertion failure: %g", (Int)message, 0, "you may 'return;'");
ErrorReturnVoid("Assertion failure: %g", (Int)message, 0, 0);
}
else {
PrintObj(message);
Expand Down
3 changes: 1 addition & 2 deletions src/funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ void RecursionDepthTrap( void )
if (GetRecursionDepth() > 0) {
recursionDepth = GetRecursionDepth();
SetRecursionDepth(0);
ErrorReturnVoid("recursion depth trap (%d)", (Int)recursionDepth, 0,
"you may 'return;'");
ErrorReturnVoid("recursion depth trap (%d)", (Int)recursionDepth, 0, 0);
SetRecursionDepth(recursionDepth);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hpc/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ static void InterruptCurrentThread(int locked, Stat stat)
if (handler)
CALL_WITH_CATCH(handler, NEW_PLIST(T_PLIST, 0));
else
ErrorReturnVoid("system interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("system interrupt", 0, 0, 0);
if (!locked)
pthread_mutex_unlock(thread->lock);
}
Expand Down
20 changes: 10 additions & 10 deletions src/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static ALWAYS_INLINE ExecStatus ExecForHelper(Stat stat, UInt nr)
#if !defined(HAVE_SIGNAL)
// test for an interrupt
if ( HaveInterrupt() ) {
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
}
#endif

Expand Down Expand Up @@ -435,7 +435,7 @@ static ALWAYS_INLINE ExecStatus ExecForHelper(Stat stat, UInt nr)
#if !defined(HAVE_SIGNAL)
// test for an interrupt
if ( HaveInterrupt() ) {
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
}
#endif

Expand Down Expand Up @@ -530,7 +530,7 @@ static ALWAYS_INLINE ExecStatus ExecForRangeHelper(Stat stat, UInt nr)
#if !defined(HAVE_SIGNAL)
// test for an interrupt
if ( HaveInterrupt() ) {
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
}
#endif

Expand Down Expand Up @@ -666,7 +666,7 @@ static ALWAYS_INLINE ExecStatus ExecWhileHelper(Stat stat, UInt nr)
#if !defined(HAVE_SIGNAL)
// test for an interrupt
if ( HaveInterrupt() ) {
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
}
#endif

Expand Down Expand Up @@ -737,7 +737,7 @@ static ALWAYS_INLINE ExecStatus ExecRepeatHelper(Stat stat, UInt nr)
#if !defined(HAVE_SIGNAL)
// test for an interrupt
if ( HaveInterrupt() ) {
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
}
#endif

Expand Down Expand Up @@ -952,7 +952,7 @@ static ExecStatus ExecReturnObj(Stat stat)
#if !defined(HAVE_SIGNAL)
// test for an interrupt
if ( HaveInterrupt() ) {
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
}
#endif

Expand Down Expand Up @@ -980,7 +980,7 @@ static ExecStatus ExecReturnVoid(Stat stat)
#if !defined(HAVE_SIGNAL)
// test for an interrupt
if ( HaveInterrupt() ) {
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
}
#endif

Expand Down Expand Up @@ -1027,7 +1027,7 @@ UInt TakeInterrupt( void )
{
if (HaveInterrupt()) {
UnInterruptExecStat();
ErrorReturnVoid("user interrupt", 0, 0, "you can 'return;'");
ErrorReturnVoid("user interrupt", 0, 0, 0);
return 1;
}
return 0;
Expand Down Expand Up @@ -1067,12 +1067,12 @@ static ExecStatus ExecIntrStat(Stat stat)
if (printError) {
ErrorReturnVoid("reached the pre-set memory limit\n"
"(change it with the -o command line option)",
0, 0, "you can 'return;'");
0, 0, 0);
}
}
else
#endif
ErrorReturnVoid( "user interrupt", 0, 0, "you can 'return;'" );
ErrorReturnVoid("user interrupt", 0, 0, 0);
#endif

// continue at the interrupted statement
Expand Down
18 changes: 6 additions & 12 deletions src/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,7 @@ static Obj FuncLOG_TO(Obj self, Obj filename)
{
RequireStringRep(SELF_NAME, filename);
if ( ! OpenLog( CONST_CSTR_STRING(filename) ) ) {
ErrorReturnVoid("LogTo: cannot log to %g", (Int)filename, 0,
"you can 'return;'");
ErrorReturnVoid("LogTo: cannot log to %g", (Int)filename, 0, 0);
return False;
}
return True;
Expand All @@ -533,8 +532,7 @@ static Obj FuncLOG_TO_STREAM(Obj self, Obj stream)
{
RequireOutputStream(SELF_NAME, stream);
if ( ! OpenLogStream(stream) ) {
ErrorReturnVoid("LogTo: cannot log to stream", 0, 0,
"you can 'return;'");
ErrorReturnVoid("LogTo: cannot log to stream", 0, 0, 0);
return False;
}
return True;
Expand Down Expand Up @@ -578,8 +576,7 @@ static Obj FuncINPUT_LOG_TO(Obj self, Obj filename)
{
RequireStringRep(SELF_NAME, filename);
if ( ! OpenInputLog( CONST_CSTR_STRING(filename) ) ) {
ErrorReturnVoid("InputLogTo: cannot log to %g", (Int)filename, 0,
"you can 'return;'");
ErrorReturnVoid("InputLogTo: cannot log to %g", (Int)filename, 0, 0);
return False;
}
return True;
Expand All @@ -594,8 +591,7 @@ static Obj FuncINPUT_LOG_TO_STREAM(Obj self, Obj stream)
{
RequireOutputStream(SELF_NAME, stream);
if ( ! OpenInputLogStream(stream) ) {
ErrorReturnVoid("InputLogTo: cannot log to stream", 0, 0,
"you can 'return;'");
ErrorReturnVoid("InputLogTo: cannot log to stream", 0, 0, 0);
return False;
}
return True;
Expand Down Expand Up @@ -639,8 +635,7 @@ static Obj FuncOUTPUT_LOG_TO(Obj self, Obj filename)
{
RequireStringRep(SELF_NAME, filename);
if ( ! OpenOutputLog( CONST_CSTR_STRING(filename) ) ) {
ErrorReturnVoid("OutputLogTo: cannot log to %g", (Int)filename, 0,
"you can 'return;'");
ErrorReturnVoid("OutputLogTo: cannot log to %g", (Int)filename, 0, 0);
return False;
}
return True;
Expand All @@ -655,8 +650,7 @@ static Obj FuncOUTPUT_LOG_TO_STREAM(Obj self, Obj stream)
{
RequireOutputStream(SELF_NAME, stream);
if ( ! OpenOutputLogStream(stream) ) {
ErrorReturnVoid("OutputLogTo: cannot log to stream", 0, 0,
"you can 'return;'");
ErrorReturnVoid("OutputLogTo: cannot log to stream", 0, 0, 0);
return False;
}
return True;
Expand Down
11 changes: 5 additions & 6 deletions src/vec8bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3002,7 +3002,7 @@ void ASS_VEC8BIT(Obj list, Obj pos, Obj elm)
ErrorReturnVoid("List assignment would increase length of "
"locked compressed vector",
0, 0,
"You can `return;' to ignore the assignment");
"you can 'return;' to ignore the assignment");
return;
}
ResizeWordSizedBag(list, SIZE_VEC8BIT(p, elts));
Expand Down Expand Up @@ -3094,7 +3094,7 @@ static Obj FuncUNB_VEC8BIT(Obj self, Obj list, Obj pos)
if (True == DoFilter(IsLockedRepresentationVector, list)) {
ErrorReturnVoid(
"Unbind of entry of locked compressed vector is forbidden", 0, 0,
"You can `return;' to ignore the assignment");
"you can 'return;' to ignore the assignment");
return 0;
}

Expand Down Expand Up @@ -3220,7 +3220,7 @@ static Obj FuncAPPEND_VEC8BIT(Obj self, Obj vecl, Obj vecr)
lenr = LEN_VEC8BIT(vecr);
if (True == DoFilter(IsLockedRepresentationVector, vecl) && lenr > 0) {
ErrorReturnVoid("Append to locked compressed vector is forbidden", 0,
0, "You can `return;' to ignore the operation");
0, "you can 'return;' to ignore the operation");
return 0;
}
info = GetFieldInfo8Bit(FIELD_VEC8BIT(vecl));
Expand Down Expand Up @@ -4369,7 +4369,7 @@ static void ResizeVec8Bit(Obj vec, UInt newlen, UInt knownclean)

if (True == DoFilter(IsLockedRepresentationVector, vec)) {
ErrorReturnVoid("Resize of locked compressed vector is forbidden", 0,
0, "You can `return;' to ignore the operation");
0, "you can 'return;' to ignore the operation");
return;
}

Expand Down Expand Up @@ -5002,8 +5002,7 @@ static Obj MakeShiftedVecs(Obj v, UInt len)
ResizeVec8Bit(vn, len, 0);
len1 = (len == 0) ? 0 : RightMostNonZeroVec8Bit(vn);
if (len1 == 0)
ErrorReturnVoid("Zero coefficient vector for reduction", 0, 0,
"you can 'return;'");
ErrorReturnVoid("Zero coefficient vector for reduction", 0, 0, 0);
if (len1 != len) {
ResizeVec8Bit(vn, len1, 1);
len = len1;
Expand Down
4 changes: 2 additions & 2 deletions src/vecgf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3826,7 +3826,7 @@ FuncREDUCE_COEFFS_GF2VEC(Obj self, Obj vec1, Obj len1, Obj vec2, Obj len2)

if (len2a == 0) {
ErrorReturnVoid("ReduceCoeffs: second argument must not be zero", 0,
0, "you may 'return;' to skip the reduction");
0, "you can 'return;' to skip the reduction");
return 0;
}

Expand Down Expand Up @@ -3872,7 +3872,7 @@ FuncQUOTREM_COEFFS_GF2VEC(Obj self, Obj vec1, Obj len1, Obj vec2, Obj len2)
}
if (len2a == 0) {
ErrorReturnVoid("QuotremCoeffs: second argument must not be zero", 0,
0, "you may 'return;' to skip the reduction");
0, "you can 'return;' to skip the reduction");
return 0;
}

Expand Down
3 changes: 2 additions & 1 deletion tst/testspecial/mem-overflow.g.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Stack trace:
@ *stdin*:3
<function "unknown">( <arguments> )
called from read-eval loop at *stdin*:3
you can 'return;'
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> # ... then we should be in a break loop. Exit that, perform some other computations.
brk> quit;
gap> Factorial(42);
Expand Down
6 changes: 4 additions & 2 deletions tst/testspecial/stack-depth-func.g.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Stack trace:
[5] f( );
@ *stdin*:2
... at *stdin*:3
you may 'return;'
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> return; # try once more
Error, recursion depth trap (10000)
Stack trace:
Expand All @@ -29,5 +30,6 @@ Stack trace:
[5] f( );
@ *stdin*:2
... at *stdin*:3
you may 'return;'
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> QUIT;
6 changes: 4 additions & 2 deletions tst/testspecial/stack-depth-func2.g.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Stack trace:
[5] f( )
@ *stdin*:2
... at *stdin*:3
you may 'return;'
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> return; # try once more
Error, recursion depth trap (10000)
Stack trace:
Expand All @@ -29,5 +30,6 @@ Stack trace:
[5] f( )
@ *stdin*:2
... at *stdin*:3
you may 'return;'
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> QUIT;
6 changes: 4 additions & 2 deletions tst/testspecial/stack-depth-rec.g.out
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ Stack trace:
[5] String( record.(nam) )
@ GAPROOT/lib/record.gi:LINE
... at *stdin*:4
you may 'return;'
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> return; # try once more
Error, recursion depth trap (5000)
Stack trace:
Expand All @@ -97,5 +98,6 @@ Stack trace:
[5] String( record.(nam) )
@ GAPROOT/lib/record.gi:LINE
... at *stdin*:4
you may 'return;'
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> QUIT;
Loading