Branch: Tag:

2013-12-14

2013-12-14 13:57:58 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: The variant dispatcher now knows about callables.

The variant dispatcher earlier accepted anything as match for
a function or program argument.

Fixes issue where the wrong variant was called for
Crypto.RSA()->generate_key(128,5) [LysLysKOM 20595612].

6104:    case PIKE_T_PROGRAM:    case PIKE_T_FUNCTION:    case T_MANY: -  /* FIXME: Identify if sval is callable. */ +  /* Identify if sval is callable. */ +  res = +  (TYPEOF(*sval) == T_FUNCTION) || +  (TYPEOF(*sval) == T_PROGRAM) || +  (TYPEOF(*sval) == T_ARRAY) || +  (TYPEOF(*sval) == T_OBJECT) || +  (TYPEOF(*sval) == T_TYPE);    /* FIXME: Check arguments */    /* FIXME: Check return type */ -  res = 1; +     break;    case PIKE_T_MIXED:    res = 1;