File tree Expand file tree Collapse file tree 2 files changed +12
-16
lines changed Expand file tree Collapse file tree 2 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -630,15 +630,16 @@ end = struct
630630        output_byte ch 0x0B 
631631    |  Try  (typ , l , catches ) ->
632632        Feature. require exception_handling;
633-         output_byte ch 0x06 ;
633+         output_byte ch 0x1f ;
634634        output_blocktype st.type_names ch typ;
635-         List. iter  ~f: ( fun   i'  -> output_instruction st  ch i') l ;
635+         output_uint  ch ( List. length catches) ;
636636        List. iter
637-           ~f: (fun  (tag , l , ty ) ->
638-             output_byte ch 0x07 ;
637+           ~f: (fun  (tag , l , _ ) ->
638+             output_byte ch 0x00 ;
639639            output_uint ch (Hashtbl. find st.tag_names tag);
640-             output_instruction st  ch ( Br  (l  +   1 ,  Some  ( Pop  ty))) )
640+             output_uint  ch l )
641641          catches;
642+         List. iter ~f: (fun  i'  -> output_instruction st ch i') l;
642643        output_byte ch 0X0B 
643644
644645  and  output_instruction  st  ch  i  = 
Original file line number Diff line number Diff line change @@ -444,18 +444,13 @@ let expression_or_instructions ctx st in_function =
444444        ]
445445    |  Try  (ty , body , catches ) ->
446446        [ List 
447-             (Atom  " try " 
447+             (Atom  " try_table " 
448448            :: (block_type st ty
449-                @  List  (Atom  " do" 
450-                  :: List. map
451-                       ~f: (fun  (tag , i , ty ) ->
452-                         List 
453-                           (Atom  " catch" 
454-                           :: index st.tag_names tag
455-                           :: (instruction
456-                                 (Wa_ast. Event  Wa_code_generation. hidden_location)
457-                              @  instruction (Wa_ast. Br  (i +  1 , Some  (Pop  ty))))))
458-                       catches))
449+                @  List. map
450+                    ~f: (fun  (tag , i , _ty ) ->
451+                      List  [ Atom  " catch" Atom  (string_of_int i) ])
452+                    catches
453+                @  instructions body))
459454        ]
460455  and  instruction  i  = 
461456    match  i with 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments