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

Infix printing panics #4

Closed
Rangi42 opened this issue Jun 21, 2024 · 1 comment
Closed

Infix printing panics #4

Rangi42 opened this issue Jun 21, 2024 · 1 comment
Assignees

Comments

@Rangi42
Copy link
Contributor

Rangi42 commented Jun 21, 2024

This was using rgbobj with my local copy of rgbds-obj, since master is one commit past the latest release.

$ cat foo.asm
SECTION "test", ROM0
	ldh a, [hSPBuffer + 1]
$ ./target/debug/rgbobj -A foo.o
foo.o [118 bytes]:  RGBDS object v9 revision 9
Symbols: 1    Sections: 1    Assertions: 0


Symbols
-------

hSPBuffer [import]


Sections
--------

SECTION "test", ROM0
    $0002 (2) bytes:
    0000: f000

    1 patch:
    foo.asm(2) @ $0001 (byte)
        PC in "test" @ $0000
        RPN expression:
            Sym#0 $0001 + HRAM?
        RPN data (12 bytes):
            [81 00 00 00 00 80 01 00 00 00 00 60]
$ RUST_BACKTRACE=1 ./target/debug/rgbobj -A -r infix foo.o >/dev/null
thread 'main' panicked at /home/rangi/Desktop/rgbds-obj/src/rpn.rs:427:36:
internal error: entered unreachable code
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:145:5
   3: rgbds_obj::rpn::RpnOp::precedence
             at /home/rangi/Desktop/rgbds-obj/src/rpn.rs:427:36
   4: rgbds_obj::rpn::RpnOp::needs_parens
             at /home/rangi/Desktop/rgbds-obj/src/rpn.rs:462:23
   5: rgbds_obj::rpn::write_node::{{closure}}
             at /home/rangi/Desktop/rgbds-obj/src/rpn.rs:543:28
   6: rgbds_obj::rpn::write_node
             at /home/rangi/Desktop/rgbds-obj/src/rpn.rs:562:17
   7: rgbds_obj::rpn::RpnExpr::fmt_infix
             at /home/rangi/Desktop/rgbds-obj/src/rpn.rs:267:9
   8: <rgbds_obj::rpn::RpnExpr as core::fmt::Display>::fmt
             at /home/rangi/Desktop/rgbds-obj/src/rpn.rs:273:13
   9: <&T as core::fmt::Display>::fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:2333:62
  10: core::fmt::rt::Argument::fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/rt.rs:142:9
  11: core::fmt::run
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:1201:5
  12: core::fmt::write
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:1169:26
  13: std::io::Write::write_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/io/mod.rs:1843:15
  14: rgbobj::work
             at ./src/main.rs:568:37
  15: rgbobj::main
             at ./src/main.rs:21:23
  16: core::ops::function::FnOnce::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@ISSOtm
Copy link
Member

ISSOtm commented Jul 3, 2024

Fixed by 7c64913!

@ISSOtm ISSOtm closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants