transform: fix memory corruption issues
There was a bug in the wasm ABI lowering pass (found using AddressSanitizer on LLVM 15) that resulted in a rather subtle memory corruption. This commit fixes this issues.
Этот коммит содержится в:
		
							родитель
							
								
									62df1d7490
								
							
						
					
					
						коммит
						d435fc868b
					
				
					 1 изменённых файлов: 1 добавлений и 2 удалений
				
			
		|  | @ -88,8 +88,7 @@ func ExternalInt64AsPtr(mod llvm.Module, config *compileopts.Config) error { | ||||||
| 			// Update all users to call the external function. | 			// Update all users to call the external function. | ||||||
| 			// The old $i64wrapper function could be removed, but it may as well | 			// The old $i64wrapper function could be removed, but it may as well | ||||||
| 			// be left in place. | 			// be left in place. | ||||||
| 			for use := fn.FirstUse(); !use.IsNil(); use = use.NextUse() { | 			for _, call := range getUses(fn) { | ||||||
| 				call := use.User() |  | ||||||
| 				entryBlockBuilder.SetInsertPointBefore(call.InstructionParent().Parent().EntryBasicBlock().FirstInstruction()) | 				entryBlockBuilder.SetInsertPointBefore(call.InstructionParent().Parent().EntryBasicBlock().FirstInstruction()) | ||||||
| 				builder.SetInsertPointBefore(call) | 				builder.SetInsertPointBefore(call) | ||||||
| 				callParams := []llvm.Value{} | 				callParams := []llvm.Value{} | ||||||
|  |  | ||||||
		Загрузка…
	
	Создание таблицы
		
		Сослаться в новой задаче
	
	 Ayke van Laethem
						Ayke van Laethem