Menu

#23 Possible bug in verbs.c

open
nobody
None
5
2009-06-29
2009-06-29
No

I think there's an errant equals sign in verbs.c, in two places:

@@ -77,7 +77,7 @@
{
const char *s;

- if (!(v.type = TYPE_LIST
+ if (!(v.type == TYPE_LIST
&& v.v.list[0].v.num == 3
&& v.v.list[1].type == TYPE_OBJ
&& v.v.list[2].type == TYPE_STR
@@ -155,7 +155,7 @@
validate_verb_args(Var v, db_arg_spec * dobj, db_prep_spec * prep,
db_arg_spec * iobj)
{
- if (!(v.type = TYPE_LIST
+ if (!(v.type == TYPE_LIST
&& v.v.list[0].v.num == 3
&& v.v.list[1].type == TYPE_STR
&& v.v.list[2].type == TYPE_STR

Discussion

  • Nobody/Anonymous

    I think he's right...

     
  • Kenny Root

    Kenny Root - 2009-08-02

    This is actually an extraneous test. The built-in is registered with the args TYPE_OBJ, TYPE_LIST, TYPE_LIST. There should be no way in which this function could be called with v.type != TYPE_LIST.

    Either it should be fixed to == for pedantic reasons or entirely removed.

     

Log in to post a comment.