Skip to content

Comments

Bug Fixes#1271

Merged
tgiphil merged 6 commits intomosa:masterfrom
tgiphil:521-copilot
Feb 15, 2026
Merged

Bug Fixes#1271
tgiphil merged 6 commits intomosa:masterfrom
tgiphil:521-copilot

Conversation

@tgiphil
Copy link
Member

@tgiphil tgiphil commented Feb 15, 2026

No description provided.

Renamed the parameter valueVumber to valueNumber in the SetValueNumber method and updated all references accordingly. This improves code clarity and prevents confusion from the previous typo.
Prevent null reference exceptions in IsPhiUseless by checking for null value numbers before comparison. Ensure all operands have valid value numbers before determining if a Phi node is useless.
- Correct Info64 property in relocation entries to use ulong and proper bitwise operations for 64-bit support.
- Add null check for context.Operand1 in IsPlugged to prevent exceptions.
- Fix IsPreviousPage to check Previous instead of Next for accuracy.
Previously, AlignUp(int, int) incorrectly called AlignDown, causing it to align values downward. This commit corrects the method to call AlignUp((uint), (uint)), ensuring proper upward alignment for integer inputs.
@tgiphil tgiphil requested a review from Copilot February 15, 2026 16:42
@tgiphil tgiphil self-assigned this Feb 15, 2026
@tgiphil tgiphil added the Bug label Feb 15, 2026
@tgiphil tgiphil added this to the 2.6 Release milestone Feb 15, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes several bugs across different components of the MOSA compiler and kernel, including logical errors in property implementations, incorrect function calls, potential null reference issues, and type casting problems.

Changes:

  • Fixed property logic in PageNodeDoubleListEntry that incorrectly checked Next instead of Previous
  • Corrected AlignUp method that was incorrectly calling AlignDown
  • Added null safety checks in BasePlugTransform and ValueNumberingStage
  • Fixed type casting issues in ELF relocation entries where ushort was used instead of ulong
  • Corrected spelling of parameter name from "valueVumber" to "valueNumber"

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Source/Mosa.Kernel.BareMetal/PageNodeDoubleListEntry.cs Fixed IsPreviousPage property to check Previous instead of Next
Source/Mosa.Kernel.BareMetal/Alignment.cs Fixed AlignUp method to call AlignUp instead of AlignDown
Source/Mosa.Compiler.Framework/Transforms/Plug/BasePlugTransform.cs Added null check for context.Operand1 before accessing Method property
Source/Mosa.Compiler.Framework/Stages/ValueNumberingStage.cs Fixed parameter name typo and added null safety checks in IsPhiUseless
Source/Mosa.Compiler.Framework/Linker/Elf/RelocationEntry.cs Fixed Info64 return type from ushort to ulong
Source/Mosa.Compiler.Framework/Linker/Elf/RelocationAddendEntry.cs Fixed Info64 return type from ushort to ulong

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Added a "General Guidelines" section to copilot-instructions.md instructing not to propose or include unsafe code blocks or APIs. Also corrected grammar in the "@Azure Rule - Enable Best Practices" guideline by adding a comma.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tgiphil tgiphil merged commit e8bba2d into mosa:master Feb 15, 2026
73 checks passed
@tgiphil tgiphil deleted the 521-copilot branch February 16, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant