4 ms·
The non-GH search version: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/exiftool/exiftool%24+/eval%5B%2B%28%5D/+AND+NOT+/eval.*require/
by mdaniel 3y ago
The non-GH search version: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/exiftool/exiftool%24+/eval%5B%2B%28%5D/+AND+NOT+/eval.*require/+&patternType=regexp&sm=1 https://sourcegraph.com/search?q=context:global+repo:%5Egith...
Your observation is proper in that it did not exclude the patterns you mentioned, but in this specific case not necessary because all 4 results are shaped the exact same way:
lib/Image/ExifTool/Exif.pm
#### eval Start ($valuePtr, $val)
my $newStart = eval($$subdir{Start});
unless (Image::ExifTool::IsInt($newStart)) {
#### eval Base ($start,$base)
$subdirBase = eval($$subdir{Base}) + $base;
}
lib/Image/ExifTool/MakerNotes.pm
#### eval Start ($valuePtr)
$newStart = eval($$subdir{Start});
}
#### eval Base ($start,$base)
my $baseShift = eval($$subdir{Base});
# shift directory base (note: we may do this again below
#### eval OffsetPt ($valuePtr)
$ifdOffsetPos = eval($$subdir{OffsetPt}) - $dirStart;
}
- ptx 3y agoYou're right that excluding "eval {" is not necessary because it only occurs in the already excluded subset, but that search link is missing a lot of matches since the space character in my pattern has turned into a plus sign in yours. Try this: https://sourcegraph.com/search?q=context%3Aglobal+repo%3A%5Egithub%5C.com%2Fexiftool%2Fexiftool%24+%2Feval%5B+%28%5D%2F+AND+NOT+%2Feval.*require%2F+&patternType=regexp&sm=1&filters=%5B%5B%22lang%22%2C%22Perl%22%2C%22lang%3Aperl%22%5D%5D https://sourcegraph.com/search?q=context%3Aglobal+repo%3A%5E... There are also some cases (excluded in this search) where a charset parameter is passed around and eventually passed to eval in the LoadCharset function, e.g. from the RTF parser through the Recompose method. Not sure if that's always safe.