Frama-C Bug Tracking System - Frama-C
View Issue Details
0000673Frama-CPlug-in > slicingpublic2011-01-17 16:332014-02-12 16:55
Assigned Topatrick 
PlatformOSOS Version
Product VersionFrama-C Carbon-20101202-beta2 
Target VersionFixed in VersionFrama-C Carbon-20110201 
Summary0000673: untypable ACSL in a sliced program containing \result
DescriptionIf a function contract contains \result, then the sliced function keeps it even if it now returns void.
Steps To Reproduce===== 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)

/*@ ensures (\result ? 0);
void main(void)

$ 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.
TagsNo tags attached.
Attached Files

2011-01-17 16:59   
Mmm... it seems that it comes from a bug in Pdg function [find_fun_postcond_nodes] in [].

I must look deeper to find what it is...
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 ?
2011-01-18 16:43   
@Patrick: I have added a comment to [find_fun_postcond_nodes] in [] to give a hint of how to use the previous result.

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:52svn
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
2013-12-19 01:12patrickSource_changeset_attached => framac master 79f0b302
2014-02-12 16:55patrickSource_changeset_attached => framac stable/neon 79f0b302