Project

Profile

Help

Bug #2315

closed

NullPointerException in generated bytecode

Added by Michael Kay about 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Byte code generation
Sprint/Milestone:
Start date:
2015-02-13
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

QT3 test -s:prod-ValueComp -t:value-comp-eq-double-8 fails with an NPE when run with bytecode enabled.

The problem occurs because GenericConverterCompiler.compileToPrimitive() calls compileToItem(), which can leave a null on the stack to represent the empty sequence, and it does not generate code to handle this null value.

Further complicating the situation, it's suboptimal that GenericConverterCompiler is being used in the first place. The CastExpressionCompiler knows that it is converting untyped atomic to double, but for some reason this combination invokes the GenericConverterCompiler rather than the StringToDoubleCompiler.

Actions #1

Updated by Michael Kay about 9 years ago

  • Status changed from New to Resolved
  • Assignee set to Michael Kay

For 9.6 I have patched GenericConverterCompiler and the test now works.

For 9.7 the test was already working, using StringToDoubleCompiler. I have applied the same patch to GenericConverterCompiler, but it is essentially untested on this branch.

Actions #2

Updated by O'Neil Delpratt about 9 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.6.0.5

Bug fix applied in the Saxon 9.6.0.5 maintenance release.

Actions #3

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.6.0.5
  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.5 added

Please register to edit this issue

Also available in: Atom PDF