< prev index next >
src/share/vm/adlc/formssel.cpp
Print this page
rev 8929 : 8214059: Undefined behaviour in ADLC
Reviewed-by: shade, kbarrett
Contributed-by: Simon Tooke <stooke@redhat.com>
@@ -919,11 +919,12 @@
// Add parameters that "do not appear in match rule".
bool has_temp = false;
const char *name;
const char *kill_name = NULL;
for (_parameters.reset(); (name = _parameters.iter()) != NULL;) {
- OperandForm *opForm = (OperandForm*)_localNames[name];
+ OpClassForm *opForm = _localNames[name]->is_opclass();
+ assert(opForm != NULL, "sanity");
Effect* e = NULL;
{
const Form* form = _effects[name];
e = form ? form->is_effect() : NULL;
@@ -936,11 +937,12 @@
// uses so their operand numbering must directly follow the real
// inputs from the match rule. Fixing the numbering seems
// complex so simply enforce the restriction during parse.
if (kill_name != NULL &&
e->isa(Component::TEMP) && !e->isa(Component::DEF)) {
- OperandForm* kill = (OperandForm*)_localNames[kill_name];
+ OpClassForm* kill = _localNames[kill_name]->is_opclass();
+ assert(kill != NULL, "sanity");
globalAD->syntax_err(_linenum, "%s: %s %s must be at the end of the argument list\n",
_ident, kill->_ident, kill_name);
} else if (e->isa(Component::KILL) && !e->isa(Component::USE)) {
kill_name = name;
}
@@ -2337,11 +2339,12 @@
if (_matrule) _matrule->append_components(_localNames, _components);
// Add parameters that "do not appear in match rule".
const char *name;
for (_parameters.reset(); (name = _parameters.iter()) != NULL;) {
- OperandForm *opForm = (OperandForm*)_localNames[name];
+ OpClassForm *opForm = _localNames[name]->is_opclass();
+ assert(opForm != NULL, "sanity");
if ( _components.operand_position(name) == -1 ) {
_components.insert(name, opForm->_ident, Component::INVALID, false);
}
}
< prev index next >