1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-20 02:32:36 +00:00

Improved no-cast detection. 273/351

This commit is contained in:
jespergravgaard 2019-05-12 13:51:36 +02:00
parent e09d81cd13
commit 8db7736830

View File

@ -150,8 +150,16 @@ public class SymbolTypeConversion {
return true; return true;
if(lValueType.equals(SymbolType.WORD) && rValueType.equals(SymbolType.BYTE)) if(lValueType.equals(SymbolType.WORD) && rValueType.equals(SymbolType.BYTE))
return true; return true;
if(lValueType.equals(SymbolType.DWORD) && rValueType.equals(SymbolType.BYTE))
return true;
if(lValueType.equals(SymbolType.DWORD) && rValueType.equals(SymbolType.WORD))
return true;
if(lValueType.equals(SymbolType.SWORD) && rValueType.equals(SymbolType.SBYTE)) if(lValueType.equals(SymbolType.SWORD) && rValueType.equals(SymbolType.SBYTE))
return true; return true;
if(lValueType.equals(SymbolType.SDWORD) && rValueType.equals(SymbolType.SBYTE))
return true;
if(lValueType.equals(SymbolType.SDWORD) && rValueType.equals(SymbolType.SWORD))
return true;
if(SymbolType.NUMBER.equals(rValueType) && SymbolType.isInteger(lValueType)) { if(SymbolType.NUMBER.equals(rValueType) && SymbolType.isInteger(lValueType)) {
// L-value is still a number - constants are probably not done being identified & typed // L-value is still a number - constants are probably not done being identified & typed
return true; return true;