This is an archive of the discontinued LLVM Phabricator instance.

Add new interceptor for atof(3)
AbandonedPublic

Authored by krytarowski on Nov 3 2018, 2:43 PM.

Details

Reviewers
joerg
vitalybuka
Summary

atof - convert ASCII string to double

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Nov 3 2018, 2:43 PM
vitalybuka added inline comments.Nov 4 2018, 11:29 PM
lib/sanitizer_common/sanitizer_common_interceptors.inc
7256

const char?

7260

atof does not scan full string

test/sanitizer_common/TestCases/NetBSD/atof.cc
7

shouldn't it be a Posix test?

krytarowski added inline comments.Nov 5 2018, 6:22 AM
lib/sanitizer_common/sanitizer_common_interceptors.inc
7260

Right, I will handle it differently.

test/sanitizer_common/TestCases/NetBSD/atof.cc
7

It's standard C interface, but I defer porting it to other OSes to others.

krytarowski abandoned this revision.EditedNov 5 2018, 10:49 AM

The proper way to handle is to go for wrapping it with strtod(3), however it requires refactoring of existing sanitizers (msan, dfsan...).

I'm about to push upstream all remaining local patches and interrupt my involvement (and The NetBSD Foundation one) due to our resources and switch to other projects.
There is still a lot of work to do, but unless something will change it will wait probably for next GSoC (although I have candidates who would jump aboard).