prevent a voluntary crash and generate better code
This commit is contained in:
parent
85348f653d
commit
897b86cba2
@ -109,13 +109,15 @@ conversion(from_type, to_type)
|
||||
) {
|
||||
extern long full_mask[];
|
||||
|
||||
C_loc((arith) full_mask[(int)(to_type->tp_size)]);
|
||||
C_and(word_size);
|
||||
if (to_fund == T_SIGNED) {
|
||||
C_loc(to_type->tp_size);
|
||||
C_loc(word_size);
|
||||
C_cii();
|
||||
}
|
||||
else {
|
||||
C_loc((arith) full_mask[(int)(to_type->tp_size)]);
|
||||
C_and(word_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -177,6 +177,7 @@ initializer(struct idf *idf; int sc;)
|
||||
:
|
||||
{ if (idf->id_def->df_type->tp_fund == FUNCTION) {
|
||||
error("illegal initialization of function");
|
||||
idf->id_def->df_type->tp_fund = ERRONEOUS;
|
||||
}
|
||||
}
|
||||
[
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user