ww: preserve fallible graph allocation in self-host
This commit is contained in:
@@ -993,6 +993,18 @@ fn sepallocptrs(cap: i32) ([]*u8 | nomem) = {
|
|||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fn sepallocgraph(pkg: []seppkg, context: []sepcontext) (*sepgraph | nomem) = {
|
||||||
|
let value: *sepgraph = alloc(sepgraph{
|
||||||
|
pkg = pkg,
|
||||||
|
n = 0,
|
||||||
|
context = context,
|
||||||
|
ncontext = 0,
|
||||||
|
supportcontext = -1,
|
||||||
|
identityfailed = false,
|
||||||
|
})?;
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
fn sepmakeints(count: i32, out: *[]i32) bool = {
|
fn sepmakeints(count: i32, out: *[]i32) bool = {
|
||||||
if (count < 0) {
|
if (count < 0) {
|
||||||
sepfailsize();
|
sepfailsize();
|
||||||
@@ -3613,14 +3625,8 @@ fn buildonesepimpl(selfdir: *u8, src: *u8, entryisdir: i32,
|
|||||||
|
|
||||||
let pkgslot: []seppkg;
|
let pkgslot: []seppkg;
|
||||||
let contextslot: []sepcontext;
|
let contextslot: []sepcontext;
|
||||||
let graphallocation: (*sepgraph | nomem) = alloc(sepgraph{
|
let graphallocation: (*sepgraph | nomem) = sepallocgraph(pkgslot,
|
||||||
pkg = pkgslot,
|
contextslot);
|
||||||
n = 0,
|
|
||||||
context = contextslot,
|
|
||||||
ncontext = 0,
|
|
||||||
supportcontext = -1,
|
|
||||||
identityfailed = false,
|
|
||||||
});
|
|
||||||
let g: *sepgraph;
|
let g: *sepgraph;
|
||||||
match (graphallocation) {
|
match (graphallocation) {
|
||||||
case let value: *sepgraph => g = value;
|
case let value: *sepgraph => g = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user