Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions LM/index.lsts

This file was deleted.

50 changes: 0 additions & 50 deletions LM/type-definition.lsts

This file was deleted.

5 changes: 0 additions & 5 deletions LM/unit-type-core.lsts

This file was deleted.

8 changes: 4 additions & 4 deletions lib/core/array.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ let safe-alloc-impl(nb: USize, tt: Type<t>): t[] = (
mark-memory-as-safe(ptr as U8[], nb);

# TODO: wrap counter adjustments in conditional compilation
if not(config-v23) then safe-alloc-block-count = safe-alloc-block-count + 1;
if not(config-v23) then safe-alloc-block-count-monotonic = safe-alloc-block-count-monotonic + 1;
safe-alloc-block-count = safe-alloc-block-count + 1;
safe-alloc-block-count-monotonic = safe-alloc-block-count-monotonic + 1;

ptr
);
Expand All @@ -71,7 +71,7 @@ let safe-realloc-impl(ptr: ?[], nb: USize): ?[] = (
mark-memory-as-safe(new-ptr as U8[], nb);

# TODO: wrap counter adjustments in conditional compilation
if not(config-v23) then safe-alloc-block-count-monotonic = safe-alloc-block-count-monotonic + 1;
safe-alloc-block-count-monotonic = safe-alloc-block-count-monotonic + 1;

new-ptr
);
Expand All @@ -96,7 +96,7 @@ let safe-free(ptr: ?[]): Nil = (
# BEFORE CHANGING THIS: talk to alex

# TODO: wrap counter adjustments in conditional compilation
if not(config-v23) then safe-alloc-block-count = safe-alloc-block-count - 1;
safe-alloc-block-count = safe-alloc-block-count - 1;

free(ptr as C<"void">[]);
()
Expand Down
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-buffer-into-string.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ import lib/core/bedrock.lsts;
# 1 string literal "a"
assert( mk-vector(type(U8), 1).push(97).buffer-into-string == "a" );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 2 );
assert( safe-alloc-block-count-monotonic == 2 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-cmp.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ safe-alloc-block-count-monotonic = 0;

assert( mk-vector(type(U8), 0).push(8) == mk-vector(type(U8), 0).push(8) );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 2 );
assert( safe-alloc-block-count-monotonic == 2 );
safe-alloc-block-count-monotonic = 0;
4 changes: 2 additions & 2 deletions tests/promises/vector/bound-constructor.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ safe-alloc-block-count-monotonic = 0;

assert( mk-vector(type(U8), 123).length == 0 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;

assert( (mk-vector() : Vector<U8>).length == 0 );
Expand All @@ -28,5 +28,5 @@ safe-alloc-block-count-monotonic = 0;

assert( (mk-vector(123) : Vector<U8>).length == 0 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-index.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import lib/core/bedrock.lsts;

assert( mk-vector(type(U8), 123).push(8)[0] == 8 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-into-vector.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ safe-alloc-block-count-monotonic = 0;

assert( mk-vector(type(U8), 1).push(8).into(type(Vector<U8>)).length == 1 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
4 changes: 2 additions & 2 deletions tests/promises/vector/bound-length.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ safe-alloc-block-count-monotonic = 0;

assert( mk-vector(type(U8), 123).length == 0 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;

assert( mk-vector(type(U8), 123).push(8).length == 1 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-push.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ safe-alloc-block-count-monotonic = 0;
# reallocation necessary
assert( mk-vector(type(U8), 0).push(8).length == 1 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-realloc.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import lib/core/bedrock.lsts;

assert( mk-vector(type(U8), 0).realloc(1).length == 0 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-reverse.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ safe-alloc-block-count-monotonic = 0;

assert( mk-vector(type(U8), 0).push(8).reverse.length == 1 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-set-index.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ if true {
assert(v[0] == 9);
};
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
2 changes: 1 addition & 1 deletion tests/promises/vector/bound-sort.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ safe-alloc-block-count-monotonic = 0;

assert( mk-vector(type(U8), 0).push(8).sort.length == 1 );
assert( safe-alloc-block-count == 0 );
if not(config-v23) then assert( safe-alloc-block-count-monotonic == 1 );
assert( safe-alloc-block-count-monotonic == 1 );
safe-alloc-block-count-monotonic = 0;
27 changes: 19 additions & 8 deletions tests/promises/vector/constructor.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ assert( safe-alloc-block-count == 0 );
mk-vector(type(U8), 2);
assert( safe-alloc-block-count == 0 );

let _01 = mk-vector(type(U8), 2).push(123);
# NOTE: there are two tricks to this test
# 1) vector push cannot be ignored, so it must be stored in a variable
# 2) the variable must be garbage collected for the test
if true {
let _01 = mk-vector(type(U8), 2).push(123);
};
assert( safe-alloc-block-count == 0 );

let _02 = mk-vector(type(U8), 0).push(123);
if true {
let _02 = mk-vector(type(U8), 0).push(123);
};
assert( safe-alloc-block-count == 0 );

assert( mk-vector(type(U8), 2).push(123).push(45)[0] == 123 );
Expand All @@ -25,14 +32,18 @@ assert( safe-alloc-block-count == 0 );
assert( mk-vector(type(U8), 0).push(123).push(45)[1] == 45 );
assert( safe-alloc-block-count == 0 );

let _1 = mk-vector(type(String), 2).push("A");
let _2 = mk-vector(type(String), 2).push("A").push("B");
let _3 = mk-vector(type(String), 2).push("A").push("B").push("C");
if true {
let _1 = mk-vector(type(String), 2).push("A");
let _2 = mk-vector(type(String), 2).push("A").push("B");
let _3 = mk-vector(type(String), 2).push("A").push("B").push("C");
};
assert( safe-alloc-block-count == 0 );

let _4 = mk-vector(type(String), 0).push("A");
let _5 = mk-vector(type(String), 0).push("A").push("B");
let _6 = mk-vector(type(String), 0).push("A").push("B").push("C");
if true {
let _4 = mk-vector(type(String), 0).push("A");
let _5 = mk-vector(type(String), 0).push("A").push("B");
let _6 = mk-vector(type(String), 0).push("A").push("B").push("C");
};
assert( safe-alloc-block-count == 0 );

assert(
Expand Down
9 changes: 7 additions & 2 deletions tests/regress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ fn compile_bootstrap() {
fn run_bootstrap(target: &str, leave_tmp: bool, is_v3: bool) -> String {
if !leave_tmp { rm("tmp.c"); };
rm("a.out");

let exit = if is_v3 && target.contains("lm-") {

let mut lm_protect = target.contains("lm-");
//if target.contains("lm-ast") { lm_protect = false; };
//if target.contains("lm-tctx") { lm_protect = false; };
//if target.contains("lm-type") { lm_protect = false; };

let exit = if is_v3 && lm_protect {
Command::new("./bootstrap.exe")
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
Expand Down
Loading