| 437 | } |
| 438 | |
| 439 | static void |
| 440 | findoprnd(ITEM *ptr, int32 *pos) |
| 441 | { |
| 442 | /* since this function recurses, it could be driven to stack overflow. */ |
| 443 | check_stack_depth(); |
| 444 | |
| 445 | #ifdef BS_DEBUG |
| 446 | elog(DEBUG3, (ptr[*pos].type == OPR) ? |
| 447 | "%d %c" : "%d %d", *pos, ptr[*pos].val); |
| 448 | #endif |
| 449 | if (ptr[*pos].type == VAL) |
| 450 | { |
| 451 | ptr[*pos].left = 0; |
| 452 | (*pos)--; |
| 453 | } |
| 454 | else if (ptr[*pos].val == (int32) '!') |
| 455 | { |
| 456 | ptr[*pos].left = -1; |
| 457 | (*pos)--; |
| 458 | findoprnd(ptr, pos); |
| 459 | } |
| 460 | else |
| 461 | { |
| 462 | ITEM *curitem = &ptr[*pos]; |
| 463 | int32 tmp = *pos; |
| 464 | |
| 465 | (*pos)--; |
| 466 | findoprnd(ptr, pos); |
| 467 | curitem->left = *pos - tmp; |
| 468 | findoprnd(ptr, pos); |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | |
| 473 | /* |
no test coverage detected