printf 呼び出しで次のプログラムをスライスしようとしています。
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv) {
if (argc < 3) return 1;
int x = atoi(argv[1]);
int y = atoi(argv[2]);
printf("%d %d\n", x, y);
return 0;
}
ただし、Value Analysis プラグインは次のメッセージを表示します。
foo.c:9:[value] 関数呼び出し式の引数 (char const )の評価で非終了(argv + 2),
スライスされたプログラムは空です!これは Frama-C のバグ/機能ですか? それとも私は何か間違ったことをしていますか?
完全なトレースは次のとおりです。
$ frama-c -slice-calls printf foo.c -then-on 'Slicing export' -print
[slicing] slicing requests in progress...
[kernel] preprocessing with "gcc -C -E -I. foo.c"
[value] Analyzing a complete application starting at main
[value] Computing initial state
[value] Initial state computed
[value] Values of globals at initialization
foo.c:8:[kernel] warning: out of bounds read. assert \valid(argv+1);
[value] computing for function atoi <- main.
Called from foo.c:8.
[kernel] warning: No code for function atoi, default assigns generated
[value] Done for function atoi
foo.c:9:[kernel] warning: out of bounds read. assert \valid(argv+2);
foo.c:9:[value] Non-termination in evaluation of function call expression argument
(char const *)*(argv + 2)
[value] Recording results for main
[value] done for function main
[slicing] making slicing project 'Slicing'...
[slicing] interpreting slicing requests from the command line...
[slicing] applying all slicing requests...
[slicing] applying 0 actions...
[slicing] exporting project to 'Slicing export'...
[slicing] applying all slicing requests...
[slicing] applying 0 actions...
[sparecode] remove unused global declarations from project 'Slicing export tmp'
[sparecode] removed unused global declarations in new project 'Slicing export'
/* Generated by Frama-C */