Skip to content

[Bug] [feat/stubs] panic compiling aleo opcodes #26266

@arosboro

Description

@arosboro

Attempting to build https://github.com/zkCohort/zk_texas_holdem/tree/feat/stubs/zk_texas_holdem

% leo build
       Leo ⚠️  Attention - This command is deprecated. Use the 'run' command.

       Leo ✅ Compiled 'main.leo' into Aleo instructions
thread `main` panicked at compiler/passes/src/code_generation/visit_expressions.rs:546:29:
internal error: entered unreachable code: Type checking guarantees that imported and stub programs are well defined.
stack backtrace: 
   0: backtrace::capture::Backtrace::create
   1: backtrace::capture::Backtrace::new
   2: leo::set_panic_hook::{{closure}}
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_handler::{{closure}}
   5: std::sys_common::backtrace::__rust_end_short_backtrace
   6: _rust_begin_unwind
   7: core::panicking::panic_fmt
   8: leo_passes::code_generation::visit_expressions::<impl leo_passes::code_generation::generator::CodeGenerator>::visit_call
   9: leo_passes::code_generation::visit_expressions::<impl leo_passes::code_generation::generator::CodeGenerator>::visit_expression
  10: leo_passes::code_generation::visit_statements::<impl leo_passes::code_generation::generator::CodeGenerator>::visit_statement
  11: itertools::Itertools::join
  12: leo_passes::code_generation::visit_program::<impl leo_passes::code_generation::generator::CodeGenerator>::visit_function
  13: itertools::Itertools::join
  14: leo_passes::code_generation::<impl leo_passes::pass::Pass for leo_passes::code_generation::generator::CodeGenerator>::do_pass
  15: leo_compiler::compiler::Compiler::compile
  16: <leo_lang::cli::commands::build::Build as leo_lang::cli::commands::Command>::apply
  17: leo_lang::cli::commands::Command::execute
  18: leo_lang::cli::commands::Command::try_execute
  19: leo_lang::cli::cli::run_with_args
  20: scoped_tls::ScopedKey<T>::set
  21: leo::main
  22: std::sys_common::backtrace::__rust_begin_short_backtrace
  23: std::rt::lang_start::{{closure}}
  24: std::rt::lang_start_internal
  25: std::rt::lang_start

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/AleoHQ/leo/issues/new?labels=bug,panic&template=bug.md&title=[Bug]

note: leo-lang 1.10.0 running on Darwin 21.6.0

note: compiler args: leo build

note: compiler flags: CLI { debug: false, quiet: false, command: Build { command: Build { options: BuildOptions { offline: false, enable_symbol_table_spans: false, enable_initial_symbol_table_snapshot: false, enable_type_checked_symbol_table_snapshot: false, enable_unrolled_symbol_table_snapshot: false, enable_ast_spans: false, enable_dce: false, enable_all_ast_snapshots: false, enable_initial_input_ast_snapshot: false, enable_initial_ast_snapshot: false, enable_unrolled_ast_snapshot: false, enable_ssa_ast_snapshot: false, enable_flattened_ast_snapshot: false, enable_destructured_ast_snapshot: false, enable_inlined_ast_snapshot: false, enable_dce_ast_snapshot: false } } }, path: None, home: None }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions