zeek / spicy

C++ parser generator for dissecting protocols & files.
https://docs.zeek.org/projects/spicy
Other
248 stars 37 forks source link

terminating with uncaught exception of type std::bad_cast #325

Closed duffy-ocraven closed 4 years ago

duffy-ocraven commented 4 years ago
module Error_5894_badCast;
public type OhEff = unit {
  initialOp : uint8;
};

function recapitulatePrebytesAsDB() : void {
  local prebytesAsText: string = "a";
  for (unameit in prebytesAsText) {
    print ", %02X" % (unameit,);
  }
}

reports:

spicy/build/bin/spicy-driver /usr/local/etc/tmp/Error_5894_bad-cast_reduced.spicy < Intensified_66_67_4x_for_dissassembler.txt
libc++abi.dylib: terminating with uncaught exception of type std::bad_cast: std::bad_cast
Abort trap: 6

5953 ~/Documents/work/dev/source/usespicy$ls -l for the build-date, and spicy/build/bin/spicy-driver --v for the build:

-rwxr-xr-x  1 duffy  staff  187680 Apr 27 14:39 spicy/build/bin/spicy-driver
spicy-driver v0.4.0-154.dirty (master 51f4cd5)
duffy-ocraven commented 4 years ago

replacing the print with a statement not using unameit, gives the more helpful:

[error] Dissassemble_IA64.spicy:493-501: value not iterable

since string is not iterable.