Fix potential segfault
The newEnv variable was accessed (via the dynamicEnv) pointer after it had gone out of scope. Fixes #234.
This commit is contained in:
		
							parent
							
								
									034b6f6062
								
							
						
					
					
						commit
						ac6ceea764
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -242,9 +242,10 @@ void ExprOpHasAttr::bindVars(const StaticEnv & env)
 | 
			
		|||
 | 
			
		||||
void ExprAttrs::bindVars(const StaticEnv & env)
 | 
			
		||||
{
 | 
			
		||||
    const StaticEnv *dynamicEnv = &env;
 | 
			
		||||
    if (recursive) {
 | 
			
		||||
    const StaticEnv * dynamicEnv = &env;
 | 
			
		||||
    StaticEnv newEnv(false, &env);
 | 
			
		||||
 | 
			
		||||
    if (recursive) {
 | 
			
		||||
        dynamicEnv = &newEnv;
 | 
			
		||||
 | 
			
		||||
        unsigned int displ = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue