Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358049 - Member comparison in GridLayout is not correctly generated
Summary: Member comparison in GridLayout is not correctly generated
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Scott Greer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-19 02:13 EDT by Huang Ji Yong CLA
Modified: 2017-02-23 14:20 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Huang Ji Yong CLA 2011-09-19 02:13:34 EDT
The egl content in GridLayout
function initTable()
	if ( columns == 0 || rows == 0 )
is generated to

if (({eze$$value : this.getColumns(), eze$$signature : "I;"}.compareTo({eze$$value : 0, eze$$signature : "i;"}) == 0) || ({eze$$value : this.getRows(), eze$$signature : "I;"}.compareTo({eze$$value : 0, eze$$signature : "i;"}) == 0))) 

The {eze$$value : this.getColumns(), eze$$signature : "I;"}.compareTo throws an exception. 
Should be ({eze$$value : this.getColumns(), eze$$signature : "I;"}).compareTo

Reproducible: always
Comment 1 Huang Ji Yong CLA 2011-09-19 04:31:51 EDT
Hi Scott,
The problem happens in BinaryExpressionTemplate, genExpression
When it runs ctx.invoke(genBinaryExpression, (Type) binExpr.getOperation().getContainer(), ctx, out, binExpr), the BooleanTypeTemplate is invoked first, and then NumTypeTemplate is invokded
I test the previous correctly build, the IntTypeTemplate should be invoked instead of NumTypeTemplate.

I think the problem is in the following codes in genExpression function of BinaryExpressionTemplate
if (CommonUtilities.needsConversion(expr.getRHS().getType(), expr.getLHS().getType())) {
			IRUtils.makeCompatible(binExpr, expr.getLHS().getType(), expr.getRHS().getType());
		}
IRUtils.makeCompatible converts the int/smallint type to num type. In previous version, the int/smallint type are converted to int type.
Thus this may be an IR problem.

The correctly generated js for that line of code is simply as:
this.getColumns() == 0
Comment 2 Huang Ji Yong CLA 2011-09-19 21:38:58 EDT
Verified in 201109192102