OSDN Git Service

Don't pass in oat file name to NativeLocationInImage
authorMathieu Chartier <mathieuc@google.com>
Thu, 18 Feb 2016 02:02:40 +0000 (18:02 -0800)
committerMathieu Chartier <mathieuc@google.com>
Fri, 19 Feb 2016 01:53:53 +0000 (17:53 -0800)
commit4ba85a6b887d3ffc1627ba3e7e9b74522ba926bb
treed4680be3ad0e83784c9ce59e84b5986a31a1c9e3
parentd07e1b338ddedd03728136f136a2c4cb6df50dc4
Don't pass in oat file name to NativeLocationInImage

We already have the oat file name stored in the relocation, using
the one passed in for the image info can cause a mismatch.

I suspect this fixes a bug repated to copied methods where there
was a oat file name mismatch. When we assign the native object
relocation for the methods of a class, we use the dex cache from
that class.

However, we use method's declaring class in NativeLocationVisitor
by using ArtMethod::GetDexCache. This could result in using the
wrong ImageInfo if the declaring class is in another image.

Bug: 27216437

(cherry picked from commit e8bf134734ee7de8b89e6d3e3648de6548d8e627)

Change-Id: I9c764800370d50b2f1f121415a68fa8f25d22e63
compiler/image_writer.cc
compiler/image_writer.h