Blog

Tag Archives: value

The OCaml compiler does have some nice optimizations
Pascal Cuoq on 26 August 2011

Many OCaml programmers use it because it offers a reasonable (to them) compromise between expressivity and control over resources use. Serious OCaml users are often heard complaining about relatively simple optimizations that the compiler does not have. But this reveals as much of the kind of programmers that end up...

Read More

Easy value analysis example: putnum()
Pascal Cuoq on 12 August 2011

If some of the posts in this blog ever get re-organized into a course-style document, this one will be near the beginning, because it's simple and self-contained. The program This example was offered on our bug-tracking system: int putchar(int); void print(const char *ptr) { while (*ptr) putchar(*ptr++); } void putnum(unsigned...

Read More

Donut gibberish
Pascal Cuoq on 7 August 2011

Hey, I left out one alarm last time: donut.c:15 ... out of bounds read. assert \valid(". -~:;=!*#$@"+tmp_7); This corresponds to ". -~:;=!*#$@"[N>0?N:0] in the obfuscated code. I wanted to have a blog post about this construct in particular because I was curious whether it would break the content management system's...

Read More

Animated donut: quickly sorting out alarms
Pascal Cuoq on 29 July 2011

This post follows that post. It is a brief survey of the alarms obtained when analyzing donut.c such as a programmer might do when ey is only trying to find bugs or in the context of verification as a first step to get an estimate on the difficulty of the...

Read More

Fun with usual arithmetic conversions
Pascal Cuoq on 26 July 2011

A facetious colleague reports the following program as a bug: int main () { signed char c=0; while(1) c++; return 0; } The commandline frama-c -val -val-signed-overflow-alarms charpp.c, he says, does not emit any alarm for the c++; instruction. Indeed, the c++; above is equivalent to c = (signed char)...

Read More