fixed a small bug in tests/alloc.sl
This commit is contained in:
@@ -2,4 +2,4 @@ import nob.sl
|
|||||||
|
|
||||||
word main
|
word main
|
||||||
"ls" sh
|
"ls" sh
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ struct: Point
|
|||||||
|
|
||||||
word main
|
word main
|
||||||
32 alloc # allocate 32 bytes (enough for a Point struct)
|
32 alloc # allocate 32 bytes (enough for a Point struct)
|
||||||
|
dup
|
||||||
dup 111 swap Point.x!
|
dup 111 swap Point.x!
|
||||||
dup 222 swap Point.y!
|
dup 222 swap Point.y!
|
||||||
dup Point.x@ puti cr
|
dup Point.x@ puti cr
|
||||||
Point.y@ puti cr
|
Point.y@ puti cr
|
||||||
32 free # free the memory
|
32 free # free the memory
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user