siddhesh / fortify-metrics

Get build time statistics of _FORTIFY_SOURCE coverage for programs
Other
10 stars 3 forks source link

Fix logic around builtin detection #1

Closed theuni closed 1 year ago

theuni commented 1 year ago

Only bail out early if the call is NEITHER type of builtin.

Without this change, for me no fortification is ever detected.

gcc -fplugin=fmetrics.so -fplugin-arg-fmetrics-project=TEST tests/builtin-dynamic-object-size-0.c -c -o tests/builtin-dynamic-object-size-0.o -D_FORTIFY_SOURCE=3 -O2

Without the change: TEST:: 0:0:0

With the change: TEST:: 43:2:31

siddhesh commented 1 year ago

Oops, thanks for catching and fixing this!