mirror of
				https://github.com/lightpanda-io/browser.git
				synced 2025-10-30 07:31:47 +00:00 
			
		
		
		
	fix integer overflow for sleeping delay
This commit is contained in:
		| @@ -313,7 +313,13 @@ pub const Page = struct { | ||||
|                                 return; | ||||
|                             } | ||||
|                             _ = try scheduler.runLowPriority(); | ||||
|                             std.time.sleep(std.time.ns_per_ms * ms); | ||||
|  | ||||
|                             // We must use a u64 here b/c ms is a u32 and the | ||||
|                             // conversion to ns can generate an integer | ||||
|                             // overflow. | ||||
|                             const _ms: u64 = @intCast(ms); | ||||
|  | ||||
|                             std.time.sleep(std.time.ns_per_ms * _ms); | ||||
|                             break :SW; | ||||
|                         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Pierre Tachoire
					Pierre Tachoire