mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-27 20:41:06 +01:00
tests/gpgscm: Handle unhandled enumeration values.
* tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration values in the opcode dispatching code. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
fabb066f90
commit
707d4d95b1
@ -27,6 +27,7 @@
|
|||||||
# include <math.h>
|
# include <math.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -3650,6 +3651,7 @@ static pointer opexe_3(scheme *sc, enum scheme_opcodes op) {
|
|||||||
case OP_GRE: comp_func=num_gt; break;
|
case OP_GRE: comp_func=num_gt; break;
|
||||||
case OP_LEQ: comp_func=num_le; break;
|
case OP_LEQ: comp_func=num_le; break;
|
||||||
case OP_GEQ: comp_func=num_ge; break;
|
case OP_GEQ: comp_func=num_ge; break;
|
||||||
|
default: assert (! "reached");
|
||||||
}
|
}
|
||||||
x=sc->args;
|
x=sc->args;
|
||||||
v=nvalue(car(x));
|
v=nvalue(car(x));
|
||||||
@ -3894,12 +3896,15 @@ static pointer opexe_4(scheme *sc, enum scheme_opcodes op) {
|
|||||||
case OP_OPEN_INFILE: prop=port_input; break;
|
case OP_OPEN_INFILE: prop=port_input; break;
|
||||||
case OP_OPEN_OUTFILE: prop=port_output; break;
|
case OP_OPEN_OUTFILE: prop=port_output; break;
|
||||||
case OP_OPEN_INOUTFILE: prop=port_input|port_output; break;
|
case OP_OPEN_INOUTFILE: prop=port_input|port_output; break;
|
||||||
|
default: assert (! "reached");
|
||||||
}
|
}
|
||||||
p=port_from_filename(sc,strvalue(car(sc->args)),prop);
|
p=port_from_filename(sc,strvalue(car(sc->args)),prop);
|
||||||
if(p==sc->NIL) {
|
if(p==sc->NIL) {
|
||||||
s_return(sc,sc->F);
|
s_return(sc,sc->F);
|
||||||
}
|
}
|
||||||
s_return(sc,p);
|
s_return(sc,p);
|
||||||
|
break;
|
||||||
|
default: assert (! "reached");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_STRING_PORTS
|
#if USE_STRING_PORTS
|
||||||
@ -3910,6 +3915,7 @@ static pointer opexe_4(scheme *sc, enum scheme_opcodes op) {
|
|||||||
switch(op) {
|
switch(op) {
|
||||||
case OP_OPEN_INSTRING: prop=port_input; break;
|
case OP_OPEN_INSTRING: prop=port_input; break;
|
||||||
case OP_OPEN_INOUTSTRING: prop=port_input|port_output; break;
|
case OP_OPEN_INOUTSTRING: prop=port_input|port_output; break;
|
||||||
|
default: assert (! "reached");
|
||||||
}
|
}
|
||||||
p=port_from_string(sc, strvalue(car(sc->args)),
|
p=port_from_string(sc, strvalue(car(sc->args)),
|
||||||
strvalue(car(sc->args))+strlength(car(sc->args)), prop);
|
strvalue(car(sc->args))+strlength(car(sc->args)), prop);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user