Fix Clang 15 sign-conversion errors in span accessors #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes sign-conversion errors that cause CI/CD Pipeline failures when building with Clang 15.
Problem
Phase 115.2 added std::span accessors to Proto debug info, but several functions used
intvariables to index into spans, which expectsize_t(unsigned). Clang 15 with-Wsign-conversion(part of our strict warning flags) caught these implicit conversions and failed the build.Changes
Files Modified
src/core/ldebug.cpp (4 locations)
luaG_getfuncline(): Changed loop variable tosize_t, fixed loop conditioni < pc→i <= pcto match originalwhile(basepc++ < pc)semanticsnextline(): Changed parameter fromint pctosize_t pcchangedline(): Changed loop variable tosize_tcollectvalidlines(): Changed loop variable tosize_tsrc/serialization/lundump.cpp (3 functions)
loadConstants(): Loop variableint i→size_t iloadUpvalues(): Loop variableint i→size_t iloadDebug(): Two loop variablesint i→size_t isrc/objects/ltable.cpp (1 location)
NodeArray::allocate(): Castntosize_tin overflow checkTesting
✅ GCC 13 Release: Builds and all tests pass (2.56s)
✅ Clang 15 Release: Builds and all tests pass (2.31s)
✅ Clang 15 Debug: Builds and all tests pass (2.31s)
✅ Performance: Well within target (≤4.33s)
✅ CI/CD Pipeline: All 8 jobs passing
Performance Impact
No performance regression - all builds complete in 2.31-2.56s, well below the 4.33s threshold.
Related Issues
Fixes the CI/CD Pipeline failures on main branch (run #19579716333).
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com