mirror of
				https://git.wownero.com/wownero/RandomWOW.git
				synced 2024-08-15 00:23:14 +00:00 
			
		
		
		
	Fix a possible out-of-bounds access in superscalar generator
This commit is contained in:
		
							parent
							
								
									4296c35d79
								
							
						
					
					
						commit
						be810aca0a
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		|  | @ -637,7 +637,7 @@ namespace randomx { | |||
| 				int cycle1 = scheduleUop<false>(mop.getUop1(), portBusy, cycle); | ||||
| 				int cycle2 = scheduleUop<false>(mop.getUop2(), portBusy, cycle); | ||||
| 
 | ||||
| 				if (cycle1 == cycle2) { | ||||
| 				if (cycle1 >= 0 && cycle1 == cycle2) { | ||||
| 					if (commit) { | ||||
| 						scheduleUop<true>(mop.getUop1(), portBusy, cycle1); | ||||
| 						scheduleUop<true>(mop.getUop2(), portBusy, cycle2); | ||||
|  | @ -761,6 +761,12 @@ namespace randomx { | |||
| 				//recalculate when the instruction can be scheduled for execution based on operand availability
 | ||||
| 				scheduleCycle = scheduleMop<true>(mop, portBusy, scheduleCycle, scheduleCycle); | ||||
| 
 | ||||
| 				if (scheduleCycle < 0) { | ||||
| 					if (trace) std::cout << "Unable to map operation '" << mop.getName() << "' to execution port (cycle " << scheduleCycle << ")" << std::endl; | ||||
| 					portsSaturated = true; | ||||
| 					break; | ||||
| 				} | ||||
| 
 | ||||
| 				//calculate when the result will be ready
 | ||||
| 				depCycle = scheduleCycle + mop.getLatency(); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue