This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [re] Java executables can abort trying to access a null pointer in a leaf function


> Ok, so please provide us with the assembly source for the method that
> does the null pointer access.  Use gcj -save-temps.

I think the relevant source is

.globl _ZN11NullPointer3fooEPS_
  .type _ZN11NullPointer3fooEPS_, @function
_ZN11NullPointer3fooEPS_:
.LFB4:
  .loc 1 19 0
  pushl %ebp
.LCFI28:
  movl  %esp, %ebp
.LCFI29:
  subl  $8, %esp
.LCFI30:
.LBB5:
  .loc 1 20 0
  movl  _ZN11NullPointer1jE, %eax
  addl  $5, %eax
  movl  %eax, _ZN11NullPointer1jE
  .loc 1 21 0
  movl  12(%ebp), %eax
  movl  %eax, -4(%ebp)
  movl  -4(%ebp), %eax
  testl %eax, %eax
  jne .L17
  call  _Jv_ThrowNullPointerException
.L17:
  movl  -4(%ebp), %eax
  movl  %eax, %edx
  movl  4(%edx), %eax
  addl  $4, %eax
  movl  %eax, 4(%edx)
.LBE5:
  .loc 1 22 0
  leave
  ret
.LFE4:
  .size _ZN11NullPointer3fooEPS_, .-_ZN11NullPointer3fooEPS_
  .align 2
.globl _ZN11NullPointerC1Ev
  .type _ZN11NullPointerC1Ev, @function


I'm also attaching the entire NullPointer.s file in case I'm
misreading the assembly (which I probably am)

Attachment: NullPointer.s.gz
Description: GNU Zip compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]