Skip to content

Commit

Permalink
Assert if ScratchRegisterManager is unable to provide a register
Browse files Browse the repository at this point in the history
The ScratchRegisterManager quietly returns NULL if it is unable to provide a
scratch register.  This is actually a serious problem and the logic should
assert fatally rather than return NULL.

Signed-off-by: Daryl Maier <maier@ca.ibm.com>
  • Loading branch information
0xdaryl committed May 5, 2024
1 parent 33a1542 commit 1e0a8f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/codegen/ScratchRegisterManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ TR::Register *TR_ScratchRegisterManager::findOrCreateScratchRegister(TR_Register

if (_cursor >= _capacity)
{
traceMsg(_cg->comp(), "ERROR: cannot allocate any more scratch registers\n");
TR_ASSERT_FATAL(false, "ERROR: cannot allocate any more scratch registers");
return NULL;
}

Expand Down

0 comments on commit 1e0a8f1

Please sign in to comment.