Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const sets generate internal error in compilation #1579

Closed
stevesmoot opened this issue Oct 19, 2023 · 2 comments
Closed

const sets generate internal error in compilation #1579

stevesmoot opened this issue Oct 19, 2023 · 2 comments
Assignees
Labels
Bug Something isn't working Compiler

Comments

@stevesmoot
Copy link
Collaborator

stevesmoot commented Oct 19, 2023

module testme;

global works:set<bytes> = set<bytes>(b"server", b"client");
const fails:set<bytes> = set<bytes>(b"server", b"client");

public type junk = unit {
   fire : /foo .*/;
   on fire {
# this compiles
     if (self.fire in works)
       {print self.fire;}
# this fails with internal error
     if (self.fire in fails)
       {print self.fire;}
   }
};
@stevesmoot
Copy link
Collaborator Author

stevesmoot commented Oct 19, 2023

I should have said 6.1.0-RC1 and:

 > spicyz -o test.hlto test.spicy
internal error: unexpected type, want hilti::type::Set but have hilti::type::Auto

--- Aborting
# 0   libhilti.dylib                      0x000000010398aa96 _ZN5hilti2rt9BacktraceC1Ev + 166
# 1   libhilti.dylib                      0x0000000103354a3b _ZN5hilti4util20abort_with_backtraceEv + 139
# 2   libhilti.dylib                      0x0000000103546cc0 _ZNK5hilti4util12type_erasure10ErasedBaseINS_5trait6isTypeENS_4type6detail7ConceptENS6_5ModelEJEE2asINS5_3SetEEERKT_v + 240
# 3   libhilti.dylib                      0x0000000103569cfc _ZN5hilti6detail7visitor11do_dispatchIvNS_10expression17resolved_operator6detail16ResolvedOperatorEN12_GLOBAL__N_17VisitorENS1_8IteratorINS_4NodeELNS1_5OrderE0ELb0EEEEENSt3__111conditionalIXsr3stdE9is_void_vIT_EEbNSD_8optionalISF_EEE4typeERT0_RT1_RNT2_8PositionERb + 14364
# 4   libhilti.dylib                      0x0000000103563ab2 _ZN5hilti6detail7visitor11do_dispatchIvNS_10expression6detail10ExpressionEN12_GLOBAL__N_17VisitorENS1_8IteratorINS_4NodeELNS1_5OrderE0ELb0EEEEENSt3__111conditionalIXsr3stdE9is_void_vIT_EEbNSC_8optionalISE_EEE4typeERT0_RT1_RNT2_8PositionERb + 8834
# 5   libhilti.dylib                      0x0000000103551993 _ZN5hilti6detail7visitor11do_dispatchIvNS_4NodeEN12_GLOBAL__N_17VisitorENS1_8IteratorIS3_LNS1_5OrderE0ELb0EEEEENSt3__111conditionalIXsr3stdE9is_void_vIT_EEbNS9_8optionalISB_EEE4typeERT0_RT1_RNT2_8PositionERb + 7395
# 6   libhilti.dylib                      0x000000010354fb02 _ZN5hilti6detail3ast6coerceEPNS_4NodeEPNS_4UnitE + 354
# 7   libhilti.dylib                      0x00000001035166be _Z7runHookIMN5hilti6PluginENSt3__18optionalINS2_8functionIFbNS2_10shared_ptrINS0_7ContextEEEPNS0_4NodeEPNS0_4UnitEEEEEEJS7_S9_SB_EEbPbRKS1_PKS8_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEET_SS_DpRKT0_ + 1118
# 8   libhilti.dylib                      0x0000000103516c6e _ZN5hilti4Unit10resolveASTERKNS_6PluginE + 782
# 9   libhilti.dylib                      0x00000001034b9502 _ZN5hilti6Driver23_resolveUnitsWithPluginERKNS_6PluginENSt3__16vectorINS4_10shared_ptrINS_4UnitEEENS4_9allocatorIS8_EEEERi + 2738
# 10  libhilti.dylib                      0x00000001034bd0f8 _ZN5hilti6Driver13_resolveUnitsEv + 280
# 11  libhilti.dylib                      0x00000001034bee94 _ZN5hilti6Driver12compileUnitsEv + 52
# 12  libhilti.dylib                      0x00000001034bfebf _ZN5hilti6Driver7compileEv + 31
# 13  spicyz                              0x0000000100a83513 _ZN4zeek5spicy6Driver7compileEv + 307
# 14  spicyz                              0x0000000100bbb585 main + 7541
# 15  dyld                                0x00007ff80293a41f start + 1903
Abort trap: 6

@bbannier bbannier added Bug Something isn't working Compiler labels Oct 23, 2023
@bbannier bbannier self-assigned this Nov 8, 2024
@bbannier
Copy link
Member

bbannier commented Nov 8, 2024

This was fixed by c007f1d which first appeared with spicy-1.10.0.

@bbannier bbannier closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Compiler
Projects
None yet
Development

No branches or pull requests

2 participants