Fixed compiler choosing whether to emit stradjust.pri on dynamic arrays based on uninitialized memory (bug 3810, r=fyren,pred, a12=blocking).
This commit is contained in:
		
							parent
							
								
									5096aef6e7
								
							
						
					
					
						commit
						bf8c57c669
					
				| @ -2309,6 +2309,7 @@ static int declloc(int fstatic) | |||||||
|         dim_ident = doexpr2(TRUE,FALSE,FALSE,FALSE,&idxtag[numdim],&dim_sym,0,&dim_val); |         dim_ident = doexpr2(TRUE,FALSE,FALSE,FALSE,&idxtag[numdim],&dim_sym,0,&dim_val); | ||||||
|         if (dim_ident == iVARIABLE || dim_ident == iEXPRESSION || dim_ident == iARRAYCELL) { |         if (dim_ident == iVARIABLE || dim_ident == iEXPRESSION || dim_ident == iARRAYCELL) { | ||||||
|           all_constant = 0; |           all_constant = 0; | ||||||
|  |           dim[numdim] = 0; | ||||||
|         } else if (dim_ident == iCONSTEXPR) { |         } else if (dim_ident == iCONSTEXPR) { | ||||||
|           dim[numdim] = dim_val.constval; |           dim[numdim] = dim_val.constval; | ||||||
| 		  /* :TODO: :URGENT: Make sure this still works */ | 		  /* :TODO: :URGENT: Make sure this still works */ | ||||||
| @ -2335,7 +2336,7 @@ static int declloc(int fstatic) | |||||||
|         ident = iARRAY; |         ident = iARRAY; | ||||||
|         stgdel(_index, _code); |         stgdel(_index, _code); | ||||||
|       } else { |       } else { | ||||||
|         if (tag == pc_tag_string && numdim && dim[numdim-1]) { |         if (tag == pc_tag_string && numdim) { | ||||||
|           stradjust(sPRI); |           stradjust(sPRI); | ||||||
|         } |         } | ||||||
|         pushreg(sPRI); |         pushreg(sPRI); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user