IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35607


Ignore:
Timestamp:
May 30, 2013, 11:27:20 AM (13 years ago)
Author:
eugene
Message:

raise an error for binary or unary ops missing arguments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509/Ohana/src/libdvo/src/dbCheckStack.c

    r31635 r35607  
    2323
    2424  for (i = 0; i < Nstack; i++) {
     25
     26    // BINARY operators
     27    if ((stack[i].type >= DB_STACK_LOGIC) && (stack[i].type <= DB_STACK_POWER)) {
     28      if (i < 2) {
     29        gprint (GP_ERR, "syntax error for field %s (binary operator missing operand)\n", stack[i].name);
     30        goto failure;
     31      }
     32    }
     33
     34    // UNARY operators
     35    if (stack[i].type == DB_STACK_UNARY) {
     36      if (i < 1) {
     37        gprint (GP_ERR, "syntax error for field %s (unary operator missing operand)\n", stack[i].name);
     38        goto failure;
     39      }
     40    }
     41
    2542    if (stack[i].type == DB_STACK_VALUE) {
    2643
Note: See TracChangeset for help on using the changeset viewer.