[INTERPRETER]

* BUG: Fix Choose() when then the choice value is equal to the number of
  possible results plus one.


git-svn-id: svn://localhost/gambas/trunk@5068 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-08-22 09:25:35 +00:00
parent 93ef02b4e8
commit b6cc5cdbb3

View File

@ -333,7 +333,7 @@ void SUBR_choose(ushort code)
VALUE_conv_integer(PARAM);
val = PARAM->_integer.value;
if (val >= 1 && val <= NPARAM)
if (val >= 1 && val < NPARAM)
{
VALUE_conv_variant(&PARAM[val]);
*RETURN = PARAM[val];