rwhich: bound prefix_len in directory dictionary parsing
The front-compressed 'N suffix' lines come from untrusted repository
data; a hostile filesite could set N larger than the previous
directory, making memcpy(dir, prev, N) read out of bounds. Clamp N
to the actual previous directory length in both the exact and the
glob parsers.
fetch: avoid infinite loop when FETCH_RETRY=0
retry was decremented to -1 and neither 'retry > 0' nor a
'retry <= 0' exit was taken, so the failover loop spun forever.
Clamp max_retry to >= 0 and break out of the loop when no retry
budget remains.
pkg_audit: enforce extract limit on total, not per member
The size limit check compared nread against max_size - extracted where
extracted is accumulated across all archive members, so a malicious
archive with many small members could exceed the limit by the sum of
all members while each individual chunk check passed. Check the
declared entry size against the remaining budget up front.
CodeGen: Remove TargetOptions::FloatABIType
This is now fully replaced with the "float-abi" module flag.
If the module flag is not present, the default is computed
from the triple. Consumers are updated to read the module flag.
RuntimeLibraryAnalysis now defers analysis until run() on a Module,
instead of during the pass constructor as before. This requires copying
all of the remaining relevant TargetOptions so they are available
when the module is seen.
Unfortunately, ARM still depends on TargetOptions for determining
the float-abi. -target-abi=aapcs16 still changes the default float-abi,
but an explicit module flag wins.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
CodeGen: Synthesize "float-abi" module flag from -float-abi
Avoid annoying test updates when the corresponding TargetOptions
field is removed. Make the -float-abi llc/opt option a lit test
convenience that records the floating-point ABI in the IR,
mirroring how -mcpu/-mattr are recorded as function attributes.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[DAGCombine][AArch64][X86] Adjust profitability check on and(anyext, c) -> zext(and) transform (#214749)
This existing fold was using a profitability check that did not work for
vector operations. It can be profitable to fold (and (anyext V), c) ->
(zext (and V, c)) if it allows the And to work on a narrower type and
possibly for the zext to be folded into other operations.
The combine is profitable or equal if the zext is the same cost as a
anyext. The old isTruncFree was removed as the value being truncated is
a constant. A basic version of isNarrowingProfitable is added for
AArch64 to allow vector types to fold providing that the result type is
legal and a isAnyExtFree method is added for the anyext cost.