btree/bt_seq.c: Fix two NULL pointer dereferences
This change fixes two NULL pointer dereferences caused by the
__bt_first function.
The first was caused by returning 0 (i.e., RET_SUCCESS) when a key
was not found, causing the caller to dereference an uninitalized
or NULL pointer. The second one was caused by an if statment clobbering
a local variable with a function call result that might be NULL.
Reported by: clang-tidy
Sponsored by: Klara, Inc.
Reviewed by: markj
Obtained from: https://github.com/apple-oss-distributions/libc (partially)
Differential Revision: https://reviews.freebsd.org/D54905
[regalloc][basic] Fix non-deterministic codegen in basic register allocator (#177998)
The basic register allocator's priority queue exhibited
non-deterministic behavior when multiple LiveIntervals had identical
spill weights. This caused different register allocation decisions
between ASAN and non-ASAN builds, leading to spurious test failures on
some internal tests.
Root Cause:
The CompSpillWeight comparator only compared spill weights:
```
return A->weight() < B->weight();
```
When two LiveIntervals had equal weights, the comparator returned false
for both comp(A,B) and comp(B,A), making them equivalent in the heap
ordering. The C++ standard does not specify the relative order of
equivalent elements in a heap. In practice, the heap's internal
structure for equivalent elements depends on implementation details and
[20 lines not shown]
console: fix overwrite of 'dhcp' configuration
Although this is correct from a pure config.xml.sample perspective
it clearly purges further configuration from the file which we better
avoid.
[TTI] Add VectorInstrContext for context-aware insert/extract costs. (#175982)
This commit introduces the VectorInstrContext (VIC) infrastructure to
improve cost estimates for insert/extracts based on the context
instruction in which the insert/extract is used.
This is similar to CastContextHint, and allows providing context on how
the insert/extract is going to be used before creating IR. This is
useful in the LoopVectorizer, where costs need to estimated before
creating IR.
The new hint currently only replaces an existing check in AArch64,
but new uses will be introduced in follow-ups, including
https://github.com/llvm/llvm-project/pull/177201.
PR: https://github.com/llvm/llvm-project/pull/175982
[flang] Missing function-vs-subroutine checks on bindings (#177699)
Derived type procedure bindings aren't always subject to the checks of
the function-vs-subroutine classification flags on their symbol table
entries in name resolution, and we're missing some cases that aren't
caught later in expression semantics, which assumed that name resolution
would have already handled them. So check function-vs-subroutine errors
on bindings in expression semantics entirely.
Fixes https://github.com/llvm/llvm-project/issues/177601.
[flang] Symbol for ENTRY with RESULT has Subroutine flag set (#177671)
When creating a HostAssocDetails symbol for an ENTRY statement with an
explicit RESULT, name resolution unconditionally sets the Subroutine
flag on the symbol. Don't do that.
Fixes https://github.com/llvm/llvm-project/issues/177502.
[flang] Implemented the RANK clause of an attr-spec, per the Fortran 2023 Standard (#176979)
This implements the RANK clause per the Fortran 2023 Standard. This
includes both the parsing/semantics and un-parsing functionality. It is
a fairly straight-forward change.
An executable test was added that tests the examples from the Fortran
2023 What's New document.
check-flang, check-flang-rt, and llvm-lit tests have been executed
against this change.
---------
Co-authored-by: Kevin Wyatt <kwyatt at hpe.com>
[Github] Add glob patterns for `clang:ssaf` label (#178079)
This change updates the `new-prs-labeler.yml` file to automatically add
`clang:ssaf` label to PRs that add or modify SSAF headers,
implementation, tests and documentation.
[libc++] Honor __SANITIZER_DISABLE_CONTAINER_OVERFLOW__ in libc++ (#168955)
Address sanitizer recently got a new macro __SANITIZER_DISABLE_CONTAINER_OVERFLOW__
which is intended to disable container overflow checks in libraries (either the
standard library or user libraries that might provide such checks). This patch makes
libc++ honor that macro and, in addition, cleans up how these checks are enabled for
string (which is special) by introducing a macro just for string.
rdar://166234942
[llvm][AIX][unit] skip AIXTargetVersionDetect when target env in effect (#178017)
The unit tests expects OS levels in the default triple to match the
host, but if we are overriding the compiled in default with an
environment setting that may not be the case.
[flang][MIF] Adding Stop and ErrorStop PRIF call procedures (#166787)
This PR proposes to add `Stop` and `ErrorStop` PRIF call procedures to the MIF
dialect. If the `-fcoarray` flag is passed, then all calls to `STOP` and `ERROR
STOP` will use those of PRIF in flang-rt. Thes procedure has been registered
during the initialization (mif::InitOp).
---------
Co-authored-by: Dan Bonachea <dobonachea at lbl.gov>