@shapeshift-labs/frontier-lang-parser 0.3.74 → 0.3.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resource-graph.js +18 -1
- package/package.json +1 -1
package/dist/resource-graph.js
CHANGED
|
@@ -86,6 +86,7 @@ export function parseResourceGraphBlock(block) {
|
|
|
86
86
|
graph.outlives = graph.lifetimeRelations;
|
|
87
87
|
graph.borrowScopeRegions = graph.borrowScopes;
|
|
88
88
|
graph.summary = summarize(graph);
|
|
89
|
+
graph.status = deriveGraphStatus(graph.status, graph.summary);
|
|
89
90
|
graph.query = {
|
|
90
91
|
resourceIds: ids(graph.resources),
|
|
91
92
|
ownerIds: ids(graph.owners),
|
|
@@ -97,7 +98,7 @@ export function parseResourceGraphBlock(block) {
|
|
|
97
98
|
lowLevelPrimitiveIds: ids([...graph.memoryRegions, ...graph.dataLayouts, ...graph.pointerEdges, ...graph.memoryAccesses, ...graph.abiBoundaries, ...graph.synchronizationEdges, ...graph.traps, ...graph.undefinedBehaviors]),
|
|
98
99
|
sourcePaths: unique(allRecords(graph).map((record) => record.sourcePath)),
|
|
99
100
|
evidenceIds: unique([...graph.evidenceIds, ...allRecords(graph).flatMap((record) => record.evidenceIds ?? [])]),
|
|
100
|
-
blockerReasonCodes:
|
|
101
|
+
blockerReasonCodes: blockerReasonCodes(graph)
|
|
101
102
|
};
|
|
102
103
|
|
|
103
104
|
return {
|
|
@@ -187,6 +188,22 @@ function summarize(graph) {
|
|
|
187
188
|
};
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
function deriveGraphStatus(authoredStatus, summary) {
|
|
192
|
+
if (
|
|
193
|
+
summary.conflicts > 0 ||
|
|
194
|
+
summary.unsafeBoundariesWithoutProof > 0 ||
|
|
195
|
+
summary.synchronizationEdgesWithoutProof > 0 ||
|
|
196
|
+
summary.trapsWithoutProof > 0 ||
|
|
197
|
+
summary.undefinedBehaviorsWithoutProof > 0
|
|
198
|
+
) return 'blocked';
|
|
199
|
+
return authoredStatus ?? 'partial';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function blockerReasonCodes(graph) {
|
|
203
|
+
const unprovedSynchronizationEdges = graph.synchronizationEdges.filter((record) => record.proofStatus !== 'passed');
|
|
204
|
+
return unique([...graph.conflicts, ...unprovedSynchronizationEdges, ...graph.traps, ...graph.undefinedBehaviors].map((record) => record.reasonCode));
|
|
205
|
+
}
|
|
206
|
+
|
|
190
207
|
function allRecords(graph) {
|
|
191
208
|
return [
|
|
192
209
|
...graph.resources,
|