mmcloughlin / avo

Generate x86 Assembly with Go
BSD 3-Clause "New" or "Revised" License
2.73k stars 89 forks source link

Allow branches without label #407

Open pelletier opened 1 year ago

pelletier commented 1 year ago

The control flow graph pass does not allow jumps that don't point to a label. In my case, I'd like to jump out of the current function to a different fallback function. I didn't see any reason why this would not be permitted in the current codebase, except if the goal is to force a control flow graph contained within the function explicitly.

This branch is based on https://github.com/mmcloughlin/avo/pull/406, but I'm happy to break it out if it's easier to review.

pelletier commented 10 months ago

@mmcloughlin As I'm going to be reworking #406, do you have any opinion on this change? https://github.com/mmcloughlin/avo/pull/407/commits/e86a5cccf71f7e045286d6b8ca0d8f5f482c211a