changed mechanism for for-loop checking, added some trap numbers
This commit is contained in:
parent
785e174cbb
commit
b6d6c4ee57
4 changed files with 7 additions and 3 deletions
|
@ -16,7 +16,6 @@ Semaphores.mod
|
||||||
random.mod
|
random.mod
|
||||||
Strings.mod
|
Strings.mod
|
||||||
catch.c
|
catch.c
|
||||||
FORchk.c
|
|
||||||
Traps.mod
|
Traps.mod
|
||||||
Arguments.c
|
Arguments.c
|
||||||
LtoUset.e
|
LtoUset.e
|
||||||
|
|
|
@ -11,4 +11,4 @@ all:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
-mkdir $(DEFDIR)
|
-mkdir $(DEFDIR)
|
||||||
for i in $(SOURCES) ; do cp $$i $(DEFDIR)/$$i ; done
|
cp $(SOURCES) $(DEFDIR)
|
||||||
|
|
|
@ -7,6 +7,9 @@ DEFINITION MODULE Traps;
|
||||||
ERRTOOMANY = 65; (* too many nested traps + handlers *)
|
ERRTOOMANY = 65; (* too many nested traps + handlers *)
|
||||||
ERRNORESULT = 66; (* no RETURN from function procedure *)
|
ERRNORESULT = 66; (* no RETURN from function procedure *)
|
||||||
ERRCARDOVFL = 67; (* CARDINAL overflow *)
|
ERRCARDOVFL = 67; (* CARDINAL overflow *)
|
||||||
|
ERRFORLOOP = 68; (* value of FOR-loop control variable changed
|
||||||
|
in loop
|
||||||
|
*)
|
||||||
|
|
||||||
TYPE TrapHandler = EM.TrapHandler;
|
TYPE TrapHandler = EM.TrapHandler;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ static struct errm {
|
||||||
{ M2_TOOMANY, "too many nested traps + handlers"},
|
{ M2_TOOMANY, "too many nested traps + handlers"},
|
||||||
{ M2_NORESULT, "no RETURN from procedure function"},
|
{ M2_NORESULT, "no RETURN from procedure function"},
|
||||||
{ M2_UOVFL, "cardinal overflow"},
|
{ M2_UOVFL, "cardinal overflow"},
|
||||||
|
{ M2_FORCH, "Warning: FOR-loop control variable was changed in the body"},
|
||||||
{ -1, 0}
|
{ -1, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,5 +71,6 @@ _catch(trapno)
|
||||||
*p = 0;
|
*p = 0;
|
||||||
Traps_Message(q, 0, (int) (p - q), 1);
|
Traps_Message(q, 0, (int) (p - q), 1);
|
||||||
}
|
}
|
||||||
exit(trapno);
|
if (trapno != M2_FORCH) exit(trapno);
|
||||||
|
SIG(_catch);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue