diff options
author | Julian Andres Klode <jak@debian.org> | 2017-08-24 16:50:12 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2017-08-24 16:56:48 +0200 |
commit | 03590fb98226bfdf3147eb78effc3fa7987709bb (patch) | |
tree | c8b0650b24d6086f6bbc656caf2876c0ed3b6632 /apt-pkg/cachefilter.cc | |
parent | d64ef1c36b2885f1f178f5438c1a4f67f8bdee88 (diff) |
Redefine APT_CONST to mean APT_PURE
Functions marked with the const attribute may not inspect
any global memory. This includes targets of pointers or
references passed as arguments. A pure function however
is free to inspect memory, but may not have any side
effects.
The function StringSplit() was marked as const, but took
two references to strings. When the second one was passed
as a literal as in StringSplit(name, "::") the compiler
cleverly figured out that we only inspect the address of
"::" (since StringSplit is const) and thus optimized away
the "::" content.
While patching out individual broken uses of APT_CONST
would be possible, this is already the second case, and
there might be more, so let's redefine APT_CONST to use
the pure attribute, so we don't end up with the same
situation again in some time.
Diffstat (limited to 'apt-pkg/cachefilter.cc')
0 files changed, 0 insertions, 0 deletions