Frama-C Bug Tracking System - Frama-C
View Issue Details
0000673Frama-CPlug-in > slicingpublic2011-01-17 16:332014-02-12 16:55
signoles 
patrick 
normalmajoralways
closedfixed 
Frama-C Carbon-20101202-beta2 
Frama-C Carbon-20110201 
0000673: untypable ACSL in a sliced program containing \result
If a function contract contains \result, then the sliced function keeps it even if it now returns void.
===== bug.c ===== void f(void) { return; } /*@ ensures \result == 0; */ int main(void) { f(); return 0; } ================== $ frama-c bug.c -slice-calls f -then-on "Slicing export" -print -ocode sliced_bug.c $ more sliced_bug.c /* Generated by Frama-C */ void f_slice_1(void) { return; } /*@ ensures (\result ? 0); */ void main(void) { f_slice_1(); return; } $ frama-c sliced_bug.c [kernel] preprocessing with "gcc -C -E -I. sliced_bug.c" sliced_bug.c:7:[kernel] user error: \result meaningless in annotation. [kernel] user error: skipping file "sliced_bug.c" that has errors. [kernel] Frama-C aborted because of invalid user input.
No tags attached.
Issue History
2011-01-17 16:33signolesNew Issue
2011-01-17 16:33signolesStatusnew => assigned
2011-01-17 16:33signolesAssigned To => Anne
2011-01-17 16:35signolesSummaryunparsable ACSL in a sliced program containing \result => untypable ACSL in a sliced program containing \result
2011-01-17 16:59AnneNote Added: 0001391
2011-01-17 16:59AnneStatusassigned => acknowledged
2011-01-18 09:52AnneNote Added: 0001396
2011-01-18 09:52AnneStatusacknowledged => assigned
2011-01-18 09:52AnneAssigned ToAnne => patrick
2011-01-18 09:53AnneNote View State: 1391: public
2011-01-18 16:43AnneNote Added: 0001399
2011-01-19 16:52svnCheckin
2011-01-19 16:52svnStatusassigned => resolved
2011-01-19 16:52svnResolutionopen => fixed
2011-02-09 14:36signolesStatusresolved => closed
2011-02-09 14:37signolesFixed in Version => Frama-C Carbon-20110201

Notes
(0001391)
Anne   
2011-01-17 16:59   
Mmm... it seems that it comes from a bug in Pdg function [find_fun_postcond_nodes] in [annot.ml]. I must look deeper to find what it is...
(0001396)
Anne   
2011-01-18 09:52   
The function used to know which zones (data) are needed to interpret a predicate is [!Db.Properties.Interp.To_zone.from_pred] with [!Db.Properties.Interp.To_zone.mk_ctx_func_contrat] request. The problem is that the \result is not really a 'zone'. I guess I need another function to test if \result is used in a postcondition because it would be to difficult to change [from_pred] signature since it is used for several different purposes. What do you think, Patrick ?
(0001399)
Anne   
2011-01-18 16:43   
@Patrick: I have added a comment to [find_fun_postcond_nodes] in [annot.ml] to give a hint of how to use the previous result.