Fix stack setting after error return. Some fixes to examples.

This commit is contained in:
Christoffer Lerno
2022-07-02 10:08:45 +02:00
committed by Christoffer Lerno
parent b1d83e2ccd
commit bb28f6e61c
12 changed files with 140 additions and 110 deletions

View File

@@ -0,0 +1,20 @@
module test;
import libc;
/**
* @checked a = b, b = a
*/
macro void @swap(&a, &b)
{
$typeof(a) temp = a;
a = b;
b = temp;
}
fn void main()
{
int x = 123;
int y = 456;
@swap(x, y);
libc::printf("x: %d y: %d\n", x, y);
}