APIFuzzing - a lua plugin for fuzzing and checking the API
#12
I tested APIFuzzing with cuberite debug mode.
Got an assertion failure for ... cBoat:MaterialToString Tongue

Passed 355 to cBoat:MaterialToString. The string value oak is the default, that will be returned for an unknown value:
Windows returns the expected: oak

Clang (3.9.1): returns oak and here it gets funny. Why?

This in the code:
Code:
#ifndef __clang__
    return "oak";
#endif
It looks like clang completely ignores the ifndef. Had a thought and added a else branch that returns the string magic and clang suddenly returns magic  Rolleyes
I replaced the code above with "return oak" and no warning appears in compiling. I guess if I could test a cuberite version compiled with clang 3.4 it will crash. Cannot install it, to old

Checked the linux version from the build server, it's compiled with clang 3.5. It also returns oak, no crash occurs. I think that clang 3.5 and above have a better detection for return values.
The best solution I think is to bump the minimum version of clang to 3.5 and change it in travis. Also then a pull request that removes all the #ifndef __clang__ in functions like cBoat:MaterialToString and the assertions
Reply
Thanks given by:


Messages In This Thread
RE: APIFuzzing - a lua plugin for fuzzing and checking the API - by Seadragon91 - 06-28-2017, 08:47 PM



Users browsing this thread: 4 Guest(s)