Skip to content

Commit

Permalink
Fix cppia type check for pointer and int
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugh Sanderson committed Dec 7, 2020
1 parent f228dc3 commit 8d00031
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/hx/cppia/CppiaCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,14 @@ class CppiaJitCompiler : public CppiaCompiler
if (inV1.type==jtInt && (inV2.type==jtByte || inV2.type==jtShort))
return inV1.type;

// Pointer + Int
if ( (inV1.type==jtInt||inV2.type==jtInt) && (inV1.type==jtPointer||inV2.type==jtPointer))
return jtPointer;

// TODO
//if (inV1.type!=inV2.type)
// setError("Type mismatch");
if (inV1.type!=inV2.type)
setError("Type mismatch");

return inV1.type;
}

Expand Down

0 comments on commit 8d00031

Please sign in to comment.