|
From: Florian K. <br...@ac...> - 2011-10-25 22:13:19
Attachments:
r12206-static-analysis
|
Greetings. Attached are the results from a new run of IBM's BEAM checker. There are two complaints. One is an out-of-bounds access in s390x specific code. I've already fixed that in r12232. The other complaint is in callgrind. It's happens along a complex path. I looked at it a bit and the interesting path segment begins on line 816 in bbcc.c. The condition there is taken as evidence that CLG_(current_state).bbcc could be NULL. And passing that to CLG_(push_call_stack) is a problem because that function will unconditionally dereference its first argument. Florian |
|
From: Josef W. <Jos...@gm...> - 2011-10-26 17:22:57
|
On 26.10.2011 00:13, Florian Krohm wrote: > The other complaint is in callgrind. It's happens along a complex path. > I looked at it a bit and the interesting path segment begins on line 816 > in bbcc.c. The condition there is taken as evidence that > CLG_(current_state).bbcc could be NULL. And passing that to > CLG_(push_call_stack) is a problem because that function will > unconditionally dereference its first argument. Interesting. If CLG_(current_state).bbcc is zero, the function flow should make sure that there never can be a call to CLG_(push_call_stack), as "delayed_push" will stay to be false. So, line 816 never will be executed, and I simply can get rid of the test which lets BEAM to assume that there could be problem. To play save, I'll make it an assertion. This should make BEAM happy. Thanks, Josef |
|
From: Florian K. <br...@ac...> - 2011-10-26 19:51:14
|
On 10/26/2011 01:22 PM, Josef Weidendorfer wrote: > > If CLG_(current_state).bbcc is zero, the function flow should make > sure that there never can be a call to CLG_(push_call_stack), as > "delayed_push" will stay to be false. So, line 816 never will be executed, > and I simply can get rid of the test which lets BEAM to assume that > there could be problem. > To play save, I'll make it an assertion. This should make BEAM happy. > Yes, the assertion will be understood. Thanks, Florian |