Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign extend 32bit offsets in inlineIntrinsicInflate #20970

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions runtime/compiler/p/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11316,6 +11316,11 @@ static bool inlineIntrinsicInflate(TR::Node *node, TR::CodeGenerator *cg)
generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::cmpi4, node, condReg, remainingReg, 0);
generateConditionalBranchInstruction(cg, TR::InstOpCode::beq, node, doneLabel, condReg);

// IMPORTANT: The upper 32 bits of a 64-bit register containing an int are undefined. Since the
// indices are being passed in as ints, we must ensure that their upper 32 bits are not garbage.
generateTrg1Src1Instruction(cg, TR::InstOpCode::extsw, node, inputOffsetReg, inputOffsetReg);
generateTrg1Src1Instruction(cg, TR::InstOpCode::extsw, node, outputOffsetReg, outputOffsetReg);

/*
* Determine the address of the first byte to read either by loading from dataAddr or adding the header size.
* This is followed by adding in the offset.
Expand Down