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

Assembler segfault if macros recurse infinitely #14

Open
sikthehedgehog opened this issue Apr 7, 2024 · 1 comment
Open

Assembler segfault if macros recurse infinitely #14

sikthehedgehog opened this issue Apr 7, 2024 · 1 comment

Comments

@sikthehedgehog
Copy link

So, I was writing a DMA macro and made a mistake:

DmaToVram: macro from, to, len, areg
    DmaToVram \from, \to, \len, 2, \areg
    endm

That second DmaToVram was supposed to be DmaToVramEx. Anyway, what happened is that the assembler crashed with a segfault because it recursed too much. Ideally there should be a macro nesting limit so the assembler has a chance to show a proper error message (even if the limit is something absurd like 50 or 100 nests, since the biggest concern is infinite recursion in practice).

@Brainulator9
Copy link

I mean, if the macro is calling itself, it should just stop right there, since it's not properly defined. That wouldn't stop cases where two or more macros call each other, though.

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