mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Correctly apply fixup to switch macros. Addresses new issue in #862. Updates @pool.
This commit is contained in:
@@ -393,14 +393,13 @@ macro void @stack_pool(usz $size; @body) @builtin
|
||||
};
|
||||
}
|
||||
|
||||
macro void @pool(...; @body) @builtin
|
||||
macro void @pool(TempAllocator* #other_temp = null; @body) @builtin
|
||||
{
|
||||
bool $has_arg = $vacount == 1;
|
||||
assert($vacount <= 1);
|
||||
TempAllocator* current = temp();
|
||||
var $has_arg = !$checks(var $x = #other_temp);
|
||||
$if $has_arg:
|
||||
TempAllocator* original = current;
|
||||
if (current == $vaarg(0)) current = temp_allocator_next();
|
||||
if (current == #other_temp) current = temp_allocator_next();
|
||||
$endif
|
||||
usz mark = current.used;
|
||||
defer
|
||||
|
||||
Reference in New Issue
Block a user