be sure to reinitialise IO after Restore.
This commit is contained in:
		
							
								
								
									
										4
									
								
								C/save.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								C/save.c
									
									
									
									
									
								
							@@ -1762,6 +1762,9 @@ Restore(char *s, char *lib_dir USES_REGS)
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Yap_ReOpenLoadForeign();
 | 
					  Yap_ReOpenLoadForeign();
 | 
				
			||||||
 | 
					  FreeRecords();
 | 
				
			||||||
 | 
					  /* restart IO */
 | 
				
			||||||
 | 
					  initIO();
 | 
				
			||||||
  /* reset time */
 | 
					  /* reset time */
 | 
				
			||||||
  Yap_ReInitWallTime();
 | 
					  Yap_ReInitWallTime();
 | 
				
			||||||
  Yap_InitSysPath();
 | 
					  Yap_InitSysPath();
 | 
				
			||||||
@@ -1770,7 +1773,6 @@ Restore(char *s, char *lib_dir USES_REGS)
 | 
				
			|||||||
    Yap_InitPreAllocCodeSpace();
 | 
					    Yap_InitPreAllocCodeSpace();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
  FreeRecords();
 | 
					 | 
				
			||||||
  CloseRestore();
 | 
					  CloseRestore();
 | 
				
			||||||
  if (which_save == 2) {
 | 
					  if (which_save == 2) {
 | 
				
			||||||
    Yap_unify(ARG2, MkIntTerm(0));
 | 
					    Yap_unify(ARG2, MkIntTerm(0));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user