remove iffy reliance on type punning that relies on interpreter's behavior

This commit is contained in:
Vern Paxson 2021-03-18 08:46:18 -07:00
parent 7294bb34be
commit b473bc48e1
2 changed files with 30 additions and 7 deletions

View file

@ -127,13 +127,9 @@ function format_value(value: any) : string
if ( /^set/ in tn && strstr(tn, ",") == 0 )
{
# The conversion to set here is tricky and assumes
# that the set isn't indexed via a tuple of types.
# The above check for commas in the type name
# ensures this.
local it: set[bool] = value;
for ( sv in it )
part += cat(sv);
local vec = Option::any_set_to_any_vec(value);
for ( sv in vec )
part += cat(vec[sv]);
return join_string_vec(part, ",");
}
else if ( /^vector/ in tn )