Fix handling of void.

This commit is contained in:
Huw Davies 2005-01-24 12:41:06 +00:00 committed by Alexandre Julliard
parent ef847a0303
commit 3387fc9077
1 changed files with 8 additions and 2 deletions

View File

@ -766,8 +766,11 @@ static int encode_type(
{ {
int next_vt; int next_vt;
while((next_vt = get_type_vt(type->ref)) == 0) { while((next_vt = get_type_vt(type->ref)) == 0) {
if(type->ref == NULL) {
next_vt = VT_VOID;
break;
}
type = type->ref; type = type->ref;
if(!type) error("encode_type: type->ref is null\n");
} }
encode_type(typelib, next_vt, type->ref, &target_type, NULL, NULL, &child_size); encode_type(typelib, next_vt, type->ref, &target_type, NULL, NULL, &child_size);
@ -1021,8 +1024,11 @@ static int encode_var(
vt = get_var_vt(var); vt = get_var_vt(var);
type = var->type; type = var->type;
while(!vt) { while(!vt) {
if(type->ref == NULL) {
vt = VT_VOID;
break;
}
type = type->ref; type = type->ref;
if(!type) error("encode_var: type->ref is null\n");
vt = get_type_vt(type); vt = get_type_vt(type);
} }
encode_type(typelib, vt, type, encoded_type, width, alignment, decoded_size); encode_type(typelib, vt, type, encoded_type, width, alignment, decoded_size);