| Summary: | Arrays being compared to null are being boxed | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Matt Heitz <mheitz> |
| Component: | EDT | Assignee: | Project Inbox <edt.compiler-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | jeffdouglas, pharmon |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Matt Heitz
It's not quite true that boxing should never occur on arrays, as if they are using as an argument to an inout function parm, then the array needs to be boxed and unboxed to pass the pointer around.
I looked at the defect further however, and the BoxingExpression is being created by IRUtils.makeCompatible, in this code:
public static void makeCompatible(BinaryExpression expr, Type type1, Type type2) {
Operation op = expr.getOperation();
Expression asExpr;
Type parmType1 = op.getParameters().get(0).getType();
Type parmType2 = op.getParameters().get(1).getType();
// Operation invocations never have ParameterizedType(s) as parameter types
// so always use the classifier instead of the type directly
if (type1 != null && !type1.getClassifier().equals(parmType1)) {
asExpr = makeExprCompatibleToType(expr.getLHS(), parmType1);
expr.setLHS(asExpr);
}
I have updated IRUtils so that no boxing expression is created when either of the operands of a binary expression is a NullType Verified. |