Bad record constructor initializers now give an error (addresses #34).

As opposed to a segfault.
This commit is contained in:
Jon Siwek 2012-12-04 16:29:23 -06:00
parent 75278af8a1
commit 32239ea633
3 changed files with 23 additions and 10 deletions

View file

@ -0,0 +1,3 @@
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.record-bad-ctor/record-bad-ctor.bro, line 6: no type given (asdfasdf)
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.record-bad-ctor/record-bad-ctor.bro, line 7: uninitialized list value ($ports=asdfasdf)
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.record-bad-ctor/record-bad-ctor.bro, line 7: bad record initializer ([$ports=asdfasdf])

View file

@ -0,0 +1,8 @@
# @TEST-EXEC-FAIL: bro -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
# At least shouldn't crash Bro, just report the invalid record ctor.
global asdfasdf;
const blah = [$ports=asdfasdf];
print blah;