mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 00:27:07 -05:00 
			
		
		
		
	[swfinterp] Implement equals opcode
This commit is contained in:
		
							
								
								
									
										10
									
								
								test/swftests/EqualsOperator.as
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								test/swftests/EqualsOperator.as
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
// input: []
 | 
			
		||||
// output: false
 | 
			
		||||
 | 
			
		||||
package {
 | 
			
		||||
public class EqualsOperator {
 | 
			
		||||
    public static function main():Boolean{
 | 
			
		||||
        return 1 == 2;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
@@ -629,6 +629,11 @@ class SWFInterpreter(object):
 | 
			
		||||
                    value1 = stack.pop()
 | 
			
		||||
                    res = value1 % value2
 | 
			
		||||
                    stack.append(res)
 | 
			
		||||
                elif opcode == 171:  # equals
 | 
			
		||||
                    value2 = stack.pop()
 | 
			
		||||
                    value1 = stack.pop()
 | 
			
		||||
                    result = value1 == value2
 | 
			
		||||
                    stack.append(result)
 | 
			
		||||
                elif opcode == 175:  # greaterequals
 | 
			
		||||
                    value2 = stack.pop()
 | 
			
		||||
                    value1 = stack.pop()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user