mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch 'origin/GP-4977_DescriptorDecoderFix'
This commit is contained in:
commit
ce924f8ab5
2 changed files with 9 additions and 9 deletions
|
@ -272,7 +272,7 @@ public class DescriptorDecoder {
|
||||||
}
|
}
|
||||||
DataTypePath dataPath = new DataTypePath(sb.toString(), parts[parts.length - 1]);
|
DataTypePath dataPath = new DataTypePath(sb.toString(), parts[parts.length - 1]);
|
||||||
DataType referencedType = dtManager.getDataType(dataPath);
|
DataType referencedType = dtManager.getDataType(dataPath);
|
||||||
return new PointerDataType(referencedType);
|
return dtManager.getPointer(referencedType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -258,7 +258,7 @@ public class DescriptorDecoderTest extends AbstractGenericTest {
|
||||||
|
|
||||||
String referenceDescriptor = "Ljava/lang/Integer;";
|
String referenceDescriptor = "Ljava/lang/Integer;";
|
||||||
computedType = DescriptorDecoder.getDataTypeOfDescriptor(referenceDescriptor, dtm);
|
computedType = DescriptorDecoder.getDataTypeOfDescriptor(referenceDescriptor, dtm);
|
||||||
DataType intRef = new PointerDataType(dtInteger);
|
DataType intRef = dtm.getPointer(dtInteger);
|
||||||
assertTrue(computedType.equals(intRef));
|
assertTrue(computedType.equals(intRef));
|
||||||
|
|
||||||
String doubleDescriptor = "D";
|
String doubleDescriptor = "D";
|
||||||
|
@ -441,12 +441,12 @@ public class DescriptorDecoderTest extends AbstractGenericTest {
|
||||||
String ItoInt = "(I)Ljava/lang/Integer;";
|
String ItoInt = "(I)Ljava/lang/Integer;";
|
||||||
|
|
||||||
DataType type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(ItoInt, dtm);
|
DataType type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(ItoInt, dtm);
|
||||||
assertEquals(new PointerDataType(dtInteger), type);
|
assertEquals(dtm.getPointer(dtInteger), type);
|
||||||
|
|
||||||
String IntIntInttoInt =
|
String IntIntInttoInt =
|
||||||
"(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)Ljava/lang/Integer;";
|
"(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)Ljava/lang/Integer;";
|
||||||
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(IntIntInttoInt, dtm);
|
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(IntIntInttoInt, dtm);
|
||||||
assertEquals(new PointerDataType(dtInteger), type);
|
assertEquals(dtm.getPointer(dtInteger), type);
|
||||||
|
|
||||||
String voidTovoid = "()V";
|
String voidTovoid = "()V";
|
||||||
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(voidTovoid, dtm);
|
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(voidTovoid, dtm);
|
||||||
|
@ -460,7 +460,7 @@ public class DescriptorDecoderTest extends AbstractGenericTest {
|
||||||
"([Ljava/lang/Integer;[[Ljava/lang/Integer;)Ljava/lang/Integer;";
|
"([Ljava/lang/Integer;[[Ljava/lang/Integer;)Ljava/lang/Integer;";
|
||||||
|
|
||||||
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(OneDIntTwoDInttoInt, dtm);
|
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(OneDIntTwoDInttoInt, dtm);
|
||||||
assertEquals(new PointerDataType(dtInteger), type);
|
assertEquals(dtm.getPointer(dtInteger), type);
|
||||||
|
|
||||||
String DDtoD = "(DD)D";
|
String DDtoD = "(DD)D";
|
||||||
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(DDtoD, dtm);
|
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(DDtoD, dtm);
|
||||||
|
@ -468,11 +468,11 @@ public class DescriptorDecoderTest extends AbstractGenericTest {
|
||||||
|
|
||||||
String crazy = "(DJLjava/lang/Integer;[[Ljava/lang/Integer;)[[Ljava/lang/Integer;";
|
String crazy = "(DJLjava/lang/Integer;[[Ljava/lang/Integer;)[[Ljava/lang/Integer;";
|
||||||
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(crazy, dtm);
|
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(crazy, dtm);
|
||||||
assertEquals(dtm.getPointer(DWordDataType.dataType), type);
|
assertEquals(dtm.getPointer(dtm.getPointer(dtInteger)), type);
|
||||||
|
|
||||||
String getClass = "()Ljava/lang/Class";
|
String getClass = "()Ljava/lang/Class";
|
||||||
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(getClass, dtm);
|
type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(getClass, dtm);
|
||||||
assertEquals(PointerDataType.dataType, type);
|
assertEquals(dtm.getPointer(null), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue