6c463b7562
Previously ReturnPointer was just the first slot in the locals array, which had type `Vec<Pointer>`. But after my recent refactoring, locals is `Vec<Value>` and it became increasingly hacky to pull a pointer out of the first slot to be the value. Besides, that hack wouldn't allow ReturnPointer to ever be an `Lvalue::Local`, referring directly to a local on a higher stack frame. Now ReturnPointer has no presence in the locals array, instead being upgraded to its own field on `Frame`. This introduces a couple of new hacks, detailed by some of my FIXME comments, so that I could get the tests passing again and commit. More commits coming soon should clean up these hacks without much trouble, and overall I feel that the code is converging on a cleaner, more efficient design.
35 lines
1.0 KiB
Rust
35 lines
1.0 KiB
Rust
#![feature(custom_attribute, attr_literals)]
|
|
#![miri(memory_size=1000)]
|
|
|
|
fn bar(i: i32) {
|
|
if i < 1000 {
|
|
bar(i + 1) //~ ERROR tried to allocate 4 more bytes, but only 0 bytes are free of the 1000 byte memory
|
|
//~^NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
//~|NOTE inside call to bar
|
|
}
|
|
}
|
|
|
|
fn main() { //~NOTE inside call to main
|
|
bar(1);
|
|
//~^NOTE inside call to bar
|
|
}
|