8000 Fixes for data directives by neuschaefer · Pull Request #7 · fox32-arch/fox32asm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixes for data directives #7

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

Merged
merged 2 commits into from
Feb 1, 2023
Merged

Fixes for data directives #7

merged 2 commits into from
Feb 1, 2023

Conversation

neuschaefer
Copy link

This should fix the two issues that are currently open.

Previously, the following program:

	push.16 0
	data.16 0

... crashed fox32asm:

	thread 'main' panicked at 'internal error: entered unreachable code', src/main.rs:620:22
	stack backtrace:
	   0: rust_begin_unwind
		     at /usr/src/rustc-1.63.0/library/std/src/panicking.rs:584:5
	   1: core::panicking::panic_fmt
		     at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:142:14
	   2: core::panicking::panic
		     at /usr/src/rustc-1.63.0/library/core/src/panicking.rs:48:5
	   3: fox32asm::parse_data
	   4: fox32asm::build_ast_from_expression
	   5: fox32asm::main
	note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The issue in line 620 is that parse_data expects a constant in the form
of AstNode::Immediate32, but finds an AstNode::Immediate16, because
CURRENT_SIZE was previously set to Half. Set CURRENT_SIZE to Word when
starting to parse a new data directive, in order to fix this issue.

Fixes fox32-arch#4
@ry755 ry755 merged commit ebdf8e3 into fox32-arch:main Feb 1, 2023
@neuschaefer neuschaefer deleted the fixes branch February 1, 2023 22:35
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

Successfully merging this pull request may close these issues.

2 participants
0