Improved handling of missing types (from missing assemblies in ikvmc).

This commit is contained in:
jfrijters 2013-10-19 12:45:50 +00:00
Родитель 86c89421e9
Коммит 2ba0163cdb
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -389,7 +389,11 @@ sealed class InstructionState
st2.Push(t2);
t2 = t2.BaseTypeWrapper;
}
TypeWrapper type = null;
if(HasMissingBaseType(st1) || HasMissingBaseType(st2))
{
return VerifierTypeWrapper.Unloadable;
}
TypeWrapper type = CoreClasses.java.lang.Object.Wrapper;
for(;;)
{
t1 = st1.Count > 0 ? st1.Pop() : null;
@ -402,6 +406,19 @@ sealed class InstructionState
}
}
private static bool HasMissingBaseType(Stack<TypeWrapper> st)
{
#if STATIC_COMPILER
if (st.Pop().IsUnloadable)
{
// we have a missing type in base class hierarchy
StaticCompiler.IssueMissingTypeMessage(st.Pop().TypeAsBaseType.BaseType);
return true;
}
#endif
return false;
}
private void SetLocal1(int index, TypeWrapper type)
{
try