bsnmp: zero-fill the destination on a short ASN.1 IpAddress
asn_get_ipaddress_raw() meant to pad the 4-byte buffer after a short
copy, but the loop bound was the already-reached len and never ran,
leaving addr[len..3] uninitialised. Pad to 4.
This is harmless for the in-tree consumers (bsnmpd(1) and
libbsnmpclient) which zero the PDU before decoding it.
Reviewed by: harti, maxim
Approved by: harti
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60923
(cherry picked from commit b5e57452b62e7c185706ed8b2a86e9f8ac483357)
[AMDGPU] Enable GEP canonicalization in ctor/dtor lowering (#241309)
Use the default IRBuilder GEP canonicalization and regenerate the
constructor and destructor lowering checks. Callback array traversal
uses byte offsets of 8 and -8, with unchanged generated code.
Assisted by: GPT 6.1 Sol
Follow up to: https://github.com/llvm/llvm-project/pull/240885
RuntimeLibcalls: Add attributes inferLibFuncAttributes gives libcalls
Remove more differences with the attributes the InferFunctionAttrs
pass would add to the declared libcalls.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LLD][LTO] Release bitcode pages earlier in distributed ThinLTO (#241536)
Under --thinlto-index-only, LLD calls markBuffersAsDontNeed() after the
lto->add() loop to MADV_DONTNEED mmap'd inputs. Two issues remain:
1. Bitcode pages stay resident across the entire lto->add() loop,
peaking alongside the growing ThinLTO summary index.
2. With split LTO units (-fsplit-lto-unit, e.g. CFI), regular LTO
modules with summaries are deferred until LTO::runRegularLTO(),
re-faulting their pages into RSS for the rest of the thin link.
Evict standalone bitcode buffers incrementally after each lto->add()
call
when skipLinkedOutput is set, clear RegularLTO.ModsWithSummaries once
linked, and add lto::Config::PostRegularLTOLinkHook so LLD can call
markBuffersAsDontNeed() again before running the LTO/ThinLTO backends.
Assisted-by: Gemini
[DWARFLinker] End the qualified name hash at a repeated DIE (#240929)
hashFullyQualifiedName follows a type's DW_AT_specification or
DW_AT_abstract_origin chain and then recurses into the parent of the DIE
it lands on. If the chain points into the type's own subtree, the
recursion keeps coming back to the same DIE until the stack overflows.
finiteLoop only bounds the chain.
Keep track of the DIEs the chain lands on and end the name when one
repeats. Every step depends only on the previous DIE, so an endless
recursion always revisits one. Hashes for well-formed input don't
change.
Assisted-by: Claude
[test][ThinLTO] Precommit tests for LowerTypeTests and ICP ordering (#241598)
Add tests for the ThinLTO backend pass order around LowerTypeTestsPass
and
for sample profile ICP to CFI jump table members. With the current
order,
the sample profile loader does not annotate the .cfi bodies, and
promoted
calls compare against @foo.cfi instead of the jump table entry @foo.
Needed by #241582.
Assisted-by: Gemini
RuntimeLibcalls: Add missing attributes to libm libcalls (#241510)
Add the function and memory attributes inferLibFuncAttributes would
give the scalar libm functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[lldb] Fix universal liblldb with dynamic script interpreters (#240614)
Without --arch, llvm-nm only dumps the host slice of a universal object.
Symbols that mangle differently per architecture, such as those taking a
va_list, ended up in the liblldb exports list with only the host
spelling. ld64 requires every literal name in an exports list to exist
in every slice, so the other slice failed to link.
Scan each slice in CMAKE_OSX_ARCHITECTURES. Keep names common to all
slices literal and bracket the last character of the rest, which turns
them into patterns.
Fixes #240535
Assisted-by: Claude
[lldb] Support relocatable Mach-O DWARF sections (#239801)
Symtab::InitAddressIndexes gives symbols without a size the distance
to the next symbol, capped at the end of the section that contains the
symbol's address.
With relocatable DWARF, every section in the __DWARF segment of a
Mach-O object starts at address 0, just like __text. That means the
lookup by address can incorrectly return a DWARF section instead of
__text. The last symbol in __text then gets a size that extends past
the end of __text.
Fix this by using the section the symbol is defined in, and fall back
to the lookup by address for symbols without one.
Assisted-by: Claude
rdar://192083461
depends on https://github.com/llvm/llvm-project/pull/239797
[lldb] Track shown Module diagnostics in a ThreadSafeDenseSet (NFC) (#241603)
Module kept a heap-allocated once_flag per diagnostic, behind a
recursive mutex, only to report each message once. A thread-safe set of
message hashes does the same with less machinery, and other owners can
deduplicate diagnostics the same way.
Assisted-by: Claude
[GlobalISel] Don't fold saturating shifts in shift_of_shifted_logic_chain (#241191)
Fixes #241100
`shift_of_shifted_logic_chain` rewrote
```
SHIFT (LOGIC (SHIFT X, C0), Y), C1 -> LOGIC (SHIFT X, C0+C1), (SHIFT Y, C1)
```
for every opcode in `shift_chain_frags`, including
`G_USHLSAT`/`G_SSHLSAT`.
This is wrong for saturating shifts, since saturation depends on bits
the
logic op can clear or flip. 32-bit `ushl.sat(ushl.sat(8, 20) & 15, 11)`:
original = 0, combined = `ushl.sat(8, 31) & ushl.sat(15, 11)` = 30720.
Add `plain_shift_chain_frags` (`[G_SHL, G_ASHR, G_LSHR]`) and use it for
this
[14 lines not shown]
Power the RTL8188CU/8192CU off in urtwn_stop().
urtwn_stop() left the chip running, so the chip was never reset between inits,
and under TX load the device could hang with "device timeout"; only a replug
recovered it.
Power the chip off on stop, ported from FreeBSD urtwn_r92c_power_off()
(R92C path mostly from NetBSD), so each init starts from the same state
as after a replug. Bring back the APSD_CTRL "Initialize MAC" step in
urtwn_r92c_power_on(), removed in r1.85 when nothing turned the MAC
off. RTL8188E/8188F/8192E are left alone.
Patch by Mikolaj Kucharski
Also tested by jmc@ and myself