another set of tweaks per review comments

This commit is contained in:
Vern Paxson 2021-06-09 09:41:41 -07:00
parent d4eb0224a1
commit 7904701ffb
5 changed files with 8 additions and 11 deletions

View file

@ -2120,8 +2120,7 @@ ExprPtr ArithCoerceExpr::Reduce(Reducer* c, StmtPtr& red_stmt)
if ( IsArithmetic(t->Tag()) || IsArithmetic(ct->Tag()) )
{
auto v = FoldSingleVal(cv, t);
if ( v )
if ( auto v = FoldSingleVal(cv, t) )
return make_intrusive<ConstExpr>(v);
// else there was a coercion error, fall through
}

View file

@ -1,2 +0,0 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
expression error in ./3.zeek, line 5: type-checking failed in vector append (v += ok)

View file

@ -0,0 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
expression error in /Users/vern/warehouse/zeek-ZAM-prep3/testing/btest/.tmp/language.common-mistakes2/common-mistakes2.zeek, line 16: type-checking failed in vector append (v += ok)

View file

@ -1,15 +1,14 @@
# A companion tonguage/common-mistakes.zeek. Split off because we skip this
# test when using ZAM, since it employs a type-checking violation via
# A companion to language/common-mistakes.zeek. Split off because we skip
# this test when using ZAM, since it employs a type-checking violation via
# vector-of-any, which doesn't seem worth going out of our way to support
# in ZAM (and it isn't dead simple to do so).
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
# @TEST-EXEC: zeek -b 3.zeek >3.out 2>3.err
# @TEST-EXEC: btest-diff 3.out
# @TEST-EXEC: btest-diff 3.err
# @TEST-EXEC: zeek -b %INPUT >out 2>err
# @TEST-EXEC: btest-diff out
# @TEST-EXEC: btest-diff err
@TEST-START-FILE 3.zeek
function foo(v: vector of any)
{
print "in foo";
@ -27,4 +26,3 @@ event zeek_init()
# Unreachable
print "zeek_init done", v;
}
@TEST-END-FILE