8044538: assert(which != imm_operand) failed: instruction is not a movq reg, imm64

Fixed internal_word_Relocation::target() to not retrieve target address from code if relocation points into the constant section. Added test.

Reviewed-by: kvn, twisti, dlong
This commit is contained in:
Tobias Hartmann 2014-06-11 09:16:19 +02:00
parent 01645fc449
commit 83fc2acbd7
2 changed files with 44 additions and 6 deletions

View file

@ -877,11 +877,7 @@ address external_word_Relocation::target() {
void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
address target = _target;
if (target == NULL) {
if (addr_in_const()) {
target = new_addr_for(*(address*)addr(), src, dest);
} else {
target = new_addr_for(pd_get_address_from_code(), src, dest);
}
target = new_addr_for(this->target(), src, dest);
}
set_value(target);
}
@ -890,7 +886,11 @@ void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src,
address internal_word_Relocation::target() {
address target = _target;
if (target == NULL) {
target = pd_get_address_from_code();
if (addr_in_const()) {
target = *(address*)addr();
} else {
target = pd_get_address_from_code();
}
}
return target;
}