Branch: Tag:

2010-02-04

2010-02-04 17:45:00 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added test for bad linenumber info from if statements.

Rev: src/testsuite.in:1.889

1:   START_MARKER - test_true([["$Id: testsuite.in,v 1.888 2010/01/21 16:14:47 grubba Exp $"]]); + test_true([["$Id: testsuite.in,v 1.889 2010/02/04 17:45:00 grubba Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])
2277:    int a() {return y == 3;}   ]])    + dnl This test used to get the last line of the else block + test_any([[ +  int expected_line; +  void foo(object o) +  { +  expected_line = __LINE__ + 1; +  if (o->a && b) { +  o->a = o->b; +  } else if (o->b) { +  o->b = o->a; +  } +  }; +  mixed err = catch { foo(UNDEFINED); }; +  return err[1][-1][1] - expected_line; + ]], 0) +    dnl ----------------------------------------------------------------   dnl scopes and stuff   dnl ----------------------------------------------------------------