Fix assignment of nil to a structure.

constfold.c seems to be getting a little long in the tooth :P
This commit is contained in:
Bill Currie 2012-12-11 11:53:01 +09:00
parent 8582e9de63
commit f358364ef2
2 changed files with 6 additions and 3 deletions

View file

@ -49,7 +49,7 @@ class_from_plist (PLDictionary *pldict)
local SEL sel;
local PLItem *item;
ret.quaternion_val = nil; //FIXME should be ret = nil;
ret = nil;
classname = [(PLString*) [pldict getObjectForKey:"Class"] string];
class = obj_lookup_class (classname);
if (!class) {
@ -98,7 +98,7 @@ array_from_plist (PLArray *plarray)
local int i, count;
local @param ret;
ret.quaternion_val = nil; //FIXME should be ret = nil;
ret = nil;
array = [[Array alloc] init];
count = [plarray count];
for (i = 0; i < count; i++) {
@ -155,7 +155,7 @@ object_from_plist (PLItem *plist)
{
local @param ret;
ret.quaternion_val = nil; //FIXME should be ret = nil;
ret = nil;
switch ([plist type]) {
case QFDictionary:
return class_from_plist ((PLDictionary *) plist);

View file

@ -876,6 +876,9 @@ do_op_invalid (int op, expr_t *e, expr_t *e1, expr_t *e2)
{
type_t *t1 = get_type (e1);
type_t *t2 = get_type (e2);
if (e->e.expr.op == 'm')
return e; // assume the rest of the compiler got it right
if (is_scalar (t1) && is_scalar (t2)) {
// one or both expressions are an enum, and the other is one of
// int, float or short. Treat the enum as the other type, or as