mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Kernel: Fix assertion failure when ControlMemory is called with size=0
This commit is contained in:
		
							parent
							
								
									687d973980
								
							
						
					
					
						commit
						12390eb155
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		|  | @ -174,6 +174,10 @@ ResultCode Process::HeapFree(VAddr target, u32 size) { | ||||||
|         return ERR_INVALID_ADDRESS; |         return ERR_INVALID_ADDRESS; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     if (size == 0) { | ||||||
|  |         return RESULT_SUCCESS; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     ResultCode result = vm_manager.UnmapRange(target, size); |     ResultCode result = vm_manager.UnmapRange(target, size); | ||||||
|     if (result.IsError()) return result; |     if (result.IsError()) return result; | ||||||
| 
 | 
 | ||||||
|  | @ -226,6 +230,10 @@ ResultCode Process::LinearFree(VAddr target, u32 size) { | ||||||
|         return ERR_INVALID_ADDRESS; |         return ERR_INVALID_ADDRESS; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     if (size == 0) { | ||||||
|  |         return RESULT_SUCCESS; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     VAddr heap_end = GetLinearHeapBase() + (u32)linheap_memory->size(); |     VAddr heap_end = GetLinearHeapBase() + (u32)linheap_memory->size(); | ||||||
|     if (target + size > heap_end) { |     if (target + size > heap_end) { | ||||||
|         return ERR_INVALID_ADDRESS_STATE; |         return ERR_INVALID_ADDRESS_STATE; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue