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

Segmentation fault when jumping to illegal subscript reference #68

Closed
PikalaxALT opened this issue Jul 16, 2015 · 0 comments
Closed

Segmentation fault when jumping to illegal subscript reference #68

PikalaxALT opened this issue Jul 16, 2015 · 0 comments

Comments

@PikalaxALT
Copy link
Contributor

Example script;

Function1:
    ld a, 1
.subscript
    and a
    ret z
    scf
    ret

Function2:
    xor a
    jp .subscript

Result: Segmentation fault. No additional information is available, and it can be a struggle to try and find the offender.

What I'd like to see is: Symbol "Function2.subscript" not found. This at least tells the user where to start looking.

bentley pushed a commit that referenced this issue Jul 26, 2015
…l or bank

Fixed as follows: if the symbol doesn't exist, don't add it to the relocation
table. The functions calling createpatch will nevertheless increment PC
correctly.

Test case:

SECTION "CODE", CODE
glob:
        jp .loc

; from test/asm/banknoexist.asm:
SECTION "sec", ROM0
        db BANK(noexist)

See also issue #68
@bentley bentley closed this as completed Jul 26, 2015
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