Fixing bug with records sometimes unnecessarily coerced on assignment.

This commit is contained in:
Robin Sommer 2011-04-17 10:42:51 -07:00
parent 1cbde793d8
commit 58f86ae55d
4 changed files with 16 additions and 3 deletions

@ -1 +1 @@
Subproject commit acf25f34ab48568f5db919c9e3505ed319daa4e5 Subproject commit 409bda3a003b18c4736ef168595f20118f4d0038

View file

@ -1504,8 +1504,8 @@ int same_attrs(const Attributes* a1, const Attributes* a2)
if ( ! a1 ) if ( ! a1 )
return (a2 == 0); return (a2 == 0);
if ( a2 ) if ( ! a2 )
return 0; return (a1 == 0);
return (*a1 == *a2); return (*a1 == *a2);
} }

View file

@ -0,0 +1 @@
XXX, XXX

View file

@ -0,0 +1,12 @@
# @TEST-EXEC: bro %INPUT >output
# @TEST-EXEC: btest-diff output
type State: record {
host: string &default="NOT SET";
};
global session: State;
global s: State;
s = session;
s$host = "XXX";
print s$host, session$host;