8169112: java.lang.VerifyError: (class: GregorSamsa, method: template-bash signature: (LGregorSamsa8;)V) Register 10 contains wrong type
Reviewed-by: joehw
This commit is contained in:
parent
674416abdf
commit
ea6028f37e
@ -128,8 +128,7 @@ final class WithParam extends Instruction {
|
||||
parser.reportError(Constants.ERROR, err);
|
||||
}
|
||||
setName(parser.getQNameIgnoreDefaultNs(name));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");
|
||||
}
|
||||
|
||||
@ -151,8 +150,7 @@ final class WithParam extends Instruction {
|
||||
if (tselect instanceof ReferenceType == false) {
|
||||
_select = new CastExpr(_select, Type.Reference);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
typeCheckContents(stable);
|
||||
}
|
||||
return Type.Void;
|
||||
@ -163,23 +161,24 @@ final class WithParam extends Instruction {
|
||||
* a 'select' attribute, or in the with-param element's body
|
||||
*/
|
||||
public void translateValue(ClassGenerator classGen,
|
||||
MethodGenerator methodGen) {
|
||||
MethodGenerator methodGen)
|
||||
{
|
||||
// Compile expression is 'select' attribute if present
|
||||
if (_select != null) {
|
||||
_select.translate(classGen, methodGen);
|
||||
_select.startIterator(classGen, methodGen);
|
||||
}
|
||||
// If not, compile result tree from parameter body if present.
|
||||
// Store result tree into local variable for releasing it later
|
||||
else if (hasContents()) {
|
||||
} else if (hasContents()) {
|
||||
final InstructionList il = methodGen.getInstructionList();
|
||||
compileResultTree(classGen, methodGen);
|
||||
_domAdapter = methodGen.addLocalVariable2("@" + _escapedName, Type.ResultTree.toJCType(), il.getEnd());
|
||||
_domAdapter = methodGen.addLocalVariable2("@" + _escapedName,
|
||||
Type.ResultTree.toJCType(),
|
||||
il.getEnd());
|
||||
il.append(DUP);
|
||||
il.append(new ASTORE(_domAdapter.getIndex()));
|
||||
}
|
||||
// If neither are present then store empty string in parameter slot
|
||||
else {
|
||||
} else {
|
||||
final ConstantPoolGen cpg = classGen.getConstantPool();
|
||||
final InstructionList il = methodGen.getInstructionList();
|
||||
il.append(new PUSH(cpg, Constants.EMPTYSTRING));
|
||||
@ -223,22 +222,31 @@ final class WithParam extends Instruction {
|
||||
/**
|
||||
* Release the compiled result tree.
|
||||
*/
|
||||
public void releaseResultTree(ClassGenerator classGen, MethodGenerator methodGen) {
|
||||
public void releaseResultTree(ClassGenerator classGen,
|
||||
MethodGenerator methodGen)
|
||||
{
|
||||
if (_domAdapter != null) {
|
||||
final ConstantPoolGen cpg = classGen.getConstantPool();
|
||||
final InstructionList il = methodGen.getInstructionList();
|
||||
if (classGen.getStylesheet().callsNodeset() && classGen.getDOMClass().equals(MULTI_DOM_CLASS)) {
|
||||
final int removeDA = cpg.addMethodref(MULTI_DOM_CLASS, "removeDOMAdapter", "(" + DOM_ADAPTER_SIG + ")V");
|
||||
if (classGen.getStylesheet().callsNodeset() &&
|
||||
classGen.getDOMClass().equals(MULTI_DOM_CLASS))
|
||||
{
|
||||
final int removeDA =
|
||||
cpg.addMethodref(MULTI_DOM_CLASS, "removeDOMAdapter",
|
||||
"(" + DOM_ADAPTER_SIG + ")V");
|
||||
il.append(methodGen.loadDOM());
|
||||
il.append(new CHECKCAST(cpg.addClass(MULTI_DOM_CLASS)));
|
||||
il.append(new ALOAD(_domAdapter.getIndex()));
|
||||
il.append(new CHECKCAST(cpg.addClass(DOM_ADAPTER_CLASS)));
|
||||
il.append(new INVOKEVIRTUAL(removeDA));
|
||||
}
|
||||
final int release = cpg.addInterfaceMethodref(DOM_IMPL_CLASS, "release", "()V");
|
||||
final int release =
|
||||
cpg.addInterfaceMethodref(DOM_IMPL_CLASS, "release", "()V");
|
||||
il.append(new ALOAD(_domAdapter.getIndex()));
|
||||
il.append(new INVOKEINTERFACE(release, 1));
|
||||
_domAdapter.setEnd(il.getEnd());
|
||||
methodGen.removeLocalVariable(_domAdapter);
|
||||
_domAdapter = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8382
jaxp/test/javax/xml/jaxp/unittest/transform/Bug8169112.xsl
Normal file
8382
jaxp/test/javax/xml/jaxp/unittest/transform/Bug8169112.xsl
Normal file
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,7 @@ import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
@ -73,7 +74,7 @@ import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
|
||||
* @run testng/othervm -DrunSecMngr=true transform.TransformerTest
|
||||
* @run testng/othervm transform.TransformerTest
|
||||
* @summary Transformer Tests
|
||||
* @bug 6272879 6305029 6505031 8150704 8162598 8169772
|
||||
* @bug 6272879 6305029 6505031 8150704 8162598 8169112 8169772
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class TransformerTest {
|
||||
@ -436,6 +437,27 @@ public class TransformerTest {
|
||||
Assert.assertNull(document.getElementsByTagName("test6").item(0).getNamespaceURI(), "unexpected namespace for test6");
|
||||
}
|
||||
|
||||
/**
|
||||
* @bug 8169112
|
||||
* @summary Test compilation of large xsl file with outlining.
|
||||
*
|
||||
* This test merely compiles a large xsl file and tests if its bytecode
|
||||
* passes verification by invoking the transform() method for
|
||||
* dummy content. The test succeeds if no Exception is thrown
|
||||
*/
|
||||
@Test
|
||||
public final void testBug8169112() throws FileNotFoundException,
|
||||
TransformerException
|
||||
{
|
||||
TransformerFactory tf = TransformerFactory.newInstance();
|
||||
String xslFile = getClass().getResource("Bug8169112.xsl").toString();
|
||||
Transformer t = tf.newTransformer(new StreamSource(xslFile));
|
||||
String xmlIn = "<?xml version=\"1.0\"?><DOCROOT/>";
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(xmlIn.getBytes());
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
t.transform(new StreamSource(bis), new StreamResult(bos));
|
||||
}
|
||||
|
||||
/**
|
||||
* @bug 8169772
|
||||
* @summary Test transformation of DOM with null valued text node
|
||||
|
Loading…
x
Reference in New Issue
Block a user