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;
|
||||
};
|
||||
|
||||
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 = {
|
||||
if (count < 0) {
|
||||
sepfailsize();
|
||||
@@ -3613,14 +3625,8 @@ fn buildonesepimpl(selfdir: *u8, src: *u8, entryisdir: i32,
|
||||
|
||||
let pkgslot: []seppkg;
|
||||
let contextslot: []sepcontext;
|
||||
let graphallocation: (*sepgraph | nomem) = alloc(sepgraph{
|
||||
pkg = pkgslot,
|
||||
n = 0,
|
||||
context = contextslot,
|
||||
ncontext = 0,
|
||||
supportcontext = -1,
|
||||
identityfailed = false,
|
||||
});
|
||||
let graphallocation: (*sepgraph | nomem) = sepallocgraph(pkgslot,
|
||||
contextslot);
|
||||
let g: *sepgraph;
|
||||
match (graphallocation) {
|
||||
case let value: *sepgraph => g = value;
|
||||
|
||||
Reference in New Issue
Block a user