mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 16:11:33 +01:00 
			
		
		
		
	* delay parsing of the closing SEMICOLON of a uses clause till the
unit map is updated to avoid symbols not being found, resolves #8611 git-svn-id: trunk@23886 -
This commit is contained in:
		
							parent
							
								
									1c652eb8f9
								
							
						
					
					
						commit
						784641ec46
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							| @ -13897,6 +13897,7 @@ tests/webtbs/tw8523.pp svneol=native#text/plain | ||||
| tests/webtbs/tw8525.pp svneol=native#text/plain | ||||
| tests/webtbs/tw8573.pp svneol=native#text/plain | ||||
| tests/webtbs/tw8580.pp svneol=native#text/plain | ||||
| tests/webtbs/tw8611.pp svneol=native#text/pascal | ||||
| tests/webtbs/tw8615.pp svneol=native#text/plain | ||||
| tests/webtbs/tw8633.pp svneol=native#text/plain | ||||
| tests/webtbs/tw8660.pp svneol=native#text/plain | ||||
|  | ||||
| @ -502,8 +502,6 @@ implementation | ||||
|              end; | ||||
|             pu:=tused_unit(pu.next); | ||||
|           end; | ||||
| 
 | ||||
|          consume(_SEMICOLON); | ||||
|       end; | ||||
| 
 | ||||
| 
 | ||||
| @ -542,7 +540,10 @@ implementation | ||||
|     procedure parse_implementation_uses; | ||||
|       begin | ||||
|          if token=_USES then | ||||
|            loadunits; | ||||
|            begin | ||||
|              loadunits; | ||||
|              consume(_SEMICOLON); | ||||
|            end; | ||||
|       end; | ||||
| 
 | ||||
| 
 | ||||
| @ -743,6 +744,7 @@ type | ||||
|          i,j : longint; | ||||
|          finishstate:pfinishstate; | ||||
|          globalstate:pglobalstate; | ||||
|          consume_semicolon_after_uses:boolean; | ||||
|       begin | ||||
|          result:=true; | ||||
| 
 | ||||
| @ -847,7 +849,10 @@ type | ||||
|              { has it been compiled at a higher level ?} | ||||
|              if current_module.state=ms_compiled then | ||||
|                exit; | ||||
|            end; | ||||
|              consume_semicolon_after_uses:=true; | ||||
|            end | ||||
|          else | ||||
|            consume_semicolon_after_uses:=false; | ||||
| 
 | ||||
|          { move the global symtable from the temporary local to global } | ||||
|          current_module.globalsymtable:=current_module.localsymtable; | ||||
| @ -857,6 +862,11 @@ type | ||||
|            needs to be added implicitly } | ||||
|          current_module.updatemaps; | ||||
| 
 | ||||
|          { consume the semicolon after maps have been updated else conditional compiling expressions | ||||
|            might cause internal errors, see tw8611 } | ||||
|          if consume_semicolon_after_uses then | ||||
|            consume(_SEMICOLON); | ||||
| 
 | ||||
|          { create whole program optimisation information (may already be | ||||
|            updated in the interface, e.g., in case of classrefdef typed | ||||
|            constants } | ||||
| @ -1889,6 +1899,7 @@ type | ||||
|          force_init_final : boolean; | ||||
|          resources_used : boolean; | ||||
|          program_name : ansistring; | ||||
|          consume_semicolon_after_uses : boolean; | ||||
|       begin | ||||
|          DLLsource:=islibrary; | ||||
|          Status.IsLibrary:=IsLibrary; | ||||
| @ -2004,11 +2015,21 @@ type | ||||
| 
 | ||||
|          {Load the units used by the program we compile.} | ||||
|          if token=_USES then | ||||
|            loadunits; | ||||
|            begin | ||||
|              loadunits; | ||||
|              consume_semicolon_after_uses:=true; | ||||
|            end | ||||
|          else | ||||
|            consume_semicolon_after_uses:=false; | ||||
| 
 | ||||
|          { All units are read, now give them a number } | ||||
|          current_module.updatemaps; | ||||
| 
 | ||||
|          { consume the semicolon after maps have been updated else conditional compiling expressions | ||||
|            might cause internal errors, see tw8611 } | ||||
|          if consume_semicolon_after_uses then | ||||
|            consume(_SEMICOLON); | ||||
| 
 | ||||
|          {Insert the name of the main program into the symbol table.} | ||||
|          if current_module.realmodulename^<>'' then | ||||
|            tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module)); | ||||
|  | ||||
							
								
								
									
										12
									
								
								tests/webtbs/tw8611.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								tests/webtbs/tw8611.pp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | ||||
| program ie200501152; | ||||
| 
 | ||||
| {$mode objfpc} | ||||
| 
 | ||||
| uses | ||||
|   Classes; | ||||
| 
 | ||||
|   {$if declared(TObject)} | ||||
|   {$endif} | ||||
| 
 | ||||
| begin | ||||
| end. | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 florian
						florian