copy-and-paste bug in dimensioning a dynamic array

This commit is contained in:
Denys Duchier 2012-06-28 14:04:41 +02:00
parent c484053210
commit 8b57ca1cef

View File

@ -1047,7 +1047,7 @@ extern "C"
YAP_Term result = YAP_ARG1; YAP_Term result = YAP_ARG1;
GenericSpace* space = gecode_Space_from_term(YAP_ARG2); GenericSpace* space = gecode_Space_from_term(YAP_ARG2);
SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); SetVar x = gecode_SetVar_from_term(space, YAP_ARG3);
DYNARRAY(YAP_Term,elems,x.glbSize()); DYNARRAY(YAP_Term,elems,x.lubSize());
SetVarLubValues it(x); SetVarLubValues it(x);
int n = 0; int n = 0;
while (it()) { elems[n] = YAP_MkIntTerm(it.val()); ++it; ++n; } while (it()) { elems[n] = YAP_MkIntTerm(it.val()); ++it; ++n; }
@ -1061,7 +1061,7 @@ extern "C"
YAP_Term result = YAP_ARG1; YAP_Term result = YAP_ARG1;
GenericSpace* space = gecode_Space_from_term(YAP_ARG2); GenericSpace* space = gecode_Space_from_term(YAP_ARG2);
SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); SetVar x = gecode_SetVar_from_term(space, YAP_ARG3);
DYNARRAY(YAP_Term,elems,x.glbSize()); DYNARRAY(YAP_Term,elems,x.unknownSize());
SetVarUnknownValues it(x); SetVarUnknownValues it(x);
int n = 0; int n = 0;
while (it()) { elems[n] = YAP_MkIntTerm(it.val()); ++it; ++n; } while (it()) { elems[n] = YAP_MkIntTerm(it.val()); ++it; ++n; }