Skip to content

Commit

Permalink
Fix NullPointer Exception in TlbCodegenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasblaesing committed Mar 12, 2016
1 parent c23b590 commit 30893c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,18 @@ protected void createFunctions(TypeInfoUtil typeInfoUtil, String bindingMode) {
FUNCDESC funcDesc = typeInfoUtil.getFuncDesc(i);

TlbAbstractMethod method = null;
if (funcDesc.invkind.equals(INVOKEKIND.INVOKE_FUNC)) {
if(this.isVTableMode())
if (funcDesc.invkind.value == INVOKEKIND.INVOKE_FUNC.value) {
if(this.isVTableMode()) {
method = new TlbFunctionVTable(i, index, typeLibUtil, funcDesc, typeInfoUtil);
else
} else {
method = new TlbFunctionDispId(i, index, typeLibUtil, funcDesc, typeInfoUtil);
} else if (funcDesc.invkind.equals(INVOKEKIND.INVOKE_PROPERTYGET)) {
method = new TlbPropertyGet(i, index, typeLibUtil, funcDesc,
typeInfoUtil);
} else if (funcDesc.invkind.equals(INVOKEKIND.INVOKE_PROPERTYPUT)) {
method = new TlbPropertyPut(i, index, typeLibUtil, funcDesc,
typeInfoUtil);
} else if (funcDesc.invkind
.equals(INVOKEKIND.INVOKE_PROPERTYPUTREF)) {
method = new TlbPropertyPut(i, index, typeLibUtil, funcDesc,
typeInfoUtil);
}
} else if (funcDesc.invkind.value == INVOKEKIND.INVOKE_PROPERTYGET.value) {
method = new TlbPropertyGet(i, index, typeLibUtil, funcDesc, typeInfoUtil);
} else if (funcDesc.invkind.value == INVOKEKIND.INVOKE_PROPERTYPUT.value) {
method = new TlbPropertyPut(i, index, typeLibUtil, funcDesc, typeInfoUtil);
} else if (funcDesc.invkind.value == INVOKEKIND.INVOKE_PROPERTYPUTREF.value) {
method = new TlbPropertyPut(i, index, typeLibUtil, funcDesc, typeInfoUtil);
}

if(!isReservedMethod(method.getMethodName()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,21 @@ public TlbDispInterface(int index, String packagename,
TlbAbstractMethod method = null;

if (!isReservedMethod(methodName)) {
if (funcDesc.invkind.equals(INVOKEKIND.INVOKE_FUNC)) {
method = new TlbFunctionStub(index, typeLibUtil, funcDesc,
typeInfoUtil);
} else if (funcDesc.invkind
.equals(INVOKEKIND.INVOKE_PROPERTYGET)) {
method = new TlbPropertyGetStub(index, typeLibUtil,
funcDesc, typeInfoUtil);
} else if (funcDesc.invkind
.equals(INVOKEKIND.INVOKE_PROPERTYPUT)) {
method = new TlbPropertyPutStub(index, typeLibUtil,
funcDesc, typeInfoUtil);
} else if (funcDesc.invkind
.equals(INVOKEKIND.INVOKE_PROPERTYPUTREF)) {
method = new TlbPropertyPutStub(index, typeLibUtil,
funcDesc, typeInfoUtil);
if (funcDesc.invkind.value == INVOKEKIND.INVOKE_FUNC.value) {
method = new TlbFunctionStub(index, typeLibUtil, funcDesc, typeInfoUtil);
} else if (funcDesc.invkind.value == INVOKEKIND.INVOKE_PROPERTYGET.value) {
method = new TlbPropertyGetStub(index, typeLibUtil, funcDesc, typeInfoUtil);
} else if (funcDesc.invkind.value == INVOKEKIND.INVOKE_PROPERTYPUT.value) {
method = new TlbPropertyPutStub(index, typeLibUtil, funcDesc, typeInfoUtil);
} else if (funcDesc.invkind.value == INVOKEKIND.INVOKE_PROPERTYPUTREF.value) {
method = new TlbPropertyPutStub(index, typeLibUtil, funcDesc, typeInfoUtil);
}

this.content += method.getClassBuffer();

if (i < cFuncs - 1)
if (i < cFuncs - 1) {
this.content += CR;
}
}

// Release our function description stuff
Expand Down

0 comments on commit 30893c2

Please sign in to comment.