를 찾을 수없는 나는 간단한 코드 작성 :KLEE는 초기화되지 않은 변수 오류를 지금 KLEE을 배우고
#include "klee/klee.h"
#include <stdio.h>
#include <stdlib.h>
int test(int *p)
{
int *q = (int *) malloc(sizeof(int));
if ((*p) == (*q)) {
printf("reading uninitialized heap memory");
}
return 0;
}
int main()
{
int *p = (int *) malloc(sizeof(int));
test(p);
return 0;
}
첫째, 나는 LLVM의 비트 코드를 생성하고 난 비트 코드를 KLEE을 실행합니다. 다음은 모든 출력 :
KLEE: output directory is "/Users/yjy/WorkSpace/Test/klee-out-13"
Using STP solver backend
KLEE: WARNING: undefined reference to function: printf
KLEE: WARNING ONCE: calling external: printf(140351601907424)
reading uninitialized heap memory
KLEE: done: total instructions = 61
KLEE: done: completed paths = 4
KLEE: done: generated tests = 4
내가 KLEE 나에게 질문 포인터가 초기화되지 않는다는 오류를 제공해야한다고 생각하지만 그렇지 않습니다. 왜 KLEE이 나에게이 오류나 경고를주지 않는 이유가 무엇입니까? KLEE이 오류를 감지 할 수 없습니까? 미리 감사드립니다!