diff --git a/ivette/src/frama-c/states.ts b/ivette/src/frama-c/states.ts index 03b5165b9bbdba9272159dd2dadbd341c1dffb26..3895ee4978f75af68bed38a3677e579510941174 100644 --- a/ivette/src/frama-c/states.ts +++ b/ivette/src/frama-c/states.ts @@ -648,10 +648,10 @@ function reducer(s: Selection, action: SelectionActions): Selection { return selectLocation(s, action.location); } if (isMultipleSelect(action)) { - if (action.locations.length === 0) - return s; const index = action.index > 0 ? action.index : 0; - const selection = selectLocation(s, action.locations[index]); + const selection = + action.locations.length === 0 ? s : + selectLocation(s, action.locations[index]); return { ...selection, multiple: { diff --git a/ivette/src/renderer/ASTview.tsx b/ivette/src/renderer/ASTview.tsx index 1c71fa78b834a0fb55b173e17a8ec6ef49b2a107..4f50844ba06148864328be399f9ee4716de12cea 100644 --- a/ivette/src/renderer/ASTview.tsx +++ b/ivette/src/renderer/ASTview.tsx @@ -87,15 +87,16 @@ async function studia(marker: string, info: markerInfoData, kind: access) { const request = kind === 'Reads' ? getReadsLval : getWritesLval; const data = await Server.send(request, marker); const locations = data.direct.map(([f, m]) => ({ function: f, marker: m })); + const lval = info.name; if (locations.length > 0) { - const lval = info.name; const name = `${kind} of ${lval}`; const title = `List of statements ${ (kind === 'Reads') ? 'accessing' : 'modifying' } the memory location pointed by ${lval}.`; return { name, title, locations, index: 0 }; } - return 'MULTIPLE_CLEAR'; + const name = `No ${kind.toLowerCase()} of ${lval}`; + return { name, title: '', locations: [], index: 0 }; } // --------------------------------------------------------------------------