Revision 9b0a0ba9 filter/filter.c

View differences:

filter/filter.c
52 52

  
53 53
#define CMP_ERROR 999
54 54

  
55
void (*bt_assert_hook)(int result, struct f_inst *assert);
56

  
55 57
static struct adata *
56 58
adata_empty(struct linpool *pool, int l)
57 59
{
......
563 565

  
564 566
static struct tbf rl_runtime_err = TBF_DEFAULT_LOG_LIMITS;
565 567

  
566
#define runtime(x) do { \
567
    log_rl(&rl_runtime_err, L_ERR "filters, line %d: %s", what->lineno, x); \
568
#define runtime(fmt, ...) do { \
569
    log_rl(&rl_runtime_err, L_ERR "filters, line %d: " fmt, what->lineno, ##__VA_ARGS__); \
568 570
    res.type = T_RETURN; \
569 571
    res.val.i = F_ERROR; \
570 572
    return res; \
......
1475 1477

  
1476 1478
    break;
1477 1479

  
1480
  case P('a', 's'):	/* Birdtest Assert */
1481
    ONEARG;
1482

  
1483
    if (v1.type != T_BOOL)
1484
      runtime("Should be boolean value");
1485

  
1486
    res.type = v1.type;
1487
    res.val = v1.val;
1488

  
1489
    CALL(bt_assert_hook, res.val.i, what);
1490
    break;
1478 1491

  
1479 1492
  default:
1480 1493
    bug( "Unknown instruction %d (%c)", what->code, what->code & 0xff);

Also available in: Unified diff