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

internal error on admittedly bad statement #1580

Open
stevesmoot opened this issue Oct 19, 2023 · 1 comment
Open

internal error on admittedly bad statement #1580

stevesmoot opened this issue Oct 19, 2023 · 1 comment
Labels
Bug Something isn't working Compiler

Comments

@stevesmoot
Copy link
Collaborator

stevesmoot commented Oct 19, 2023

6.1.0-rc1

module testme;

import zeek;

public type junk = unit {
fire : /foo .*/;
on fire {
local k:string = zeek::is_orig ? "a" : "b";
}
};

It should be is_orig(), generates:

> spicyz -o test.hlto test.spicy
internal error: unexpected type, want hilti::Declaration but have hilti::node::None

--- Aborting
# 0   libhilti.dylib                      0x000000010af3fa96 _ZN5hilti2rt9BacktraceC1Ev + 166
# 1   libhilti.dylib                      0x000000010a909a3b _ZN5hilti4util20abort_with_backtraceEv + 139
# 2   libhilti.dylib                      0x000000010a86eb60 _ZNK5hilti4util12type_erasure10ErasedBaseINS_5trait6isNodeENS_4node6detail7ConceptENS6_5ModelEJEE2asINS_11DeclarationEEERKT_v + 240
# 3   libhilti.dylib                      0x000000010aab57cb _ZN5hilti13MemberVisitorclERKNS_10expression10ResolvedIDENS_7visitor8PositionIRNS_4NodeEEE + 59
# 4   libhilti.dylib                      0x000000010aab51a1 _ZN5hilti6detail7visitor15do_dispatch_oneIbNS_10expression10ResolvedIDENS3_6detail10ExpressionENS_13MemberVisitorENS1_8IteratorINS_4NodeELNS1_5OrderE0ELb0EEEEENSt3__111conditionalIXsr3stdE9is_void_vIT_EEbNSC_8optionalISE_EEE4typeERT1_RKSt9type_infoRT2_RNT3_8PositionERb + 65
# 5   libhilti.dylib                      0x000000010aab4e82 _ZN5hilti6detail7visitor11do_dispatchIbNS_10expression6detail10ExpressionENS_13MemberVisitorENS1_8IteratorINS_4NodeELNS1_5OrderE0ELb0EEEEENSt3__111conditionalIXsr3stdE9is_void_vIT_EEbNSB_8optionalISD_EEE4typeERT0_RT1_RNT2_8PositionERb + 274
# 6   libhilti.dylib                      0x000000010aab33c8 _ZN5hilti6detail7visitor11do_dispatchIbNS_4NodeENS_13MemberVisitorENS1_8IteratorIS3_LNS1_5OrderE0ELb0EEEEENSt3__111conditionalIXsr3stdE9is_void_vIT_EEbNS8_8optionalISA_EEE4typeERT0_RT1_RNT2_8PositionERb + 200
# 7   libhilti.dylib                      0x000000010aab29a0 _ZN5hilti13MemberVisitor7collectERNS_4NodeE + 176
# 8   libhilti.dylib                      0x000000010aa92d93 _ZN5hilti9Optimizer3runEv + 4915
# 9   libhilti.dylib                      0x000000010aa73e26 _ZN5hilti6Driver14_optimizeUnitsEv + 310
# 10  libhilti.dylib                      0x000000010aa73f8b _ZN5hilti6Driver12compileUnitsEv + 299
# 11  libhilti.dylib                      0x000000010aa74ebf _ZN5hilti6Driver7compileEv + 31
# 12  spicyz                              0x0000000108038513 _ZN4zeek5spicy6Driver7compileEv + 307
# 13  spicyz                              0x0000000108170585 main + 7541
# 14  dyld                                0x00007ff80293a41f start + 1903
Abort trap: 6

@bbannier
Copy link
Contributor

The actual issue is a Spicy issue when one uses a function name in a place where an expression was expected and reproduces with the following pure Spicy code:

module foo;

function fun(): bool { return True; }

fun ? 1 : 0;

@bbannier bbannier added Bug Something isn't working Compiler labels Oct 23, 2023
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