Changeset 11862 for src/Pugs/Eval

Show
Ignore:
Timestamp:
08/02/06 02:33:36 (2 years ago)
Author:
audreyt
Message:

* Perl 5 SVs used to infinitely regress with "$sv.meth" calls

when .meth was not defined in Perl5 land.
Reported by TimToady?++.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval/Var.hs

    r11640 r11862  
    154154        Just exp | not (':' `elem` drop 2 name) -> do 
    155155            typ     <- evalInvType $ unwrap exp 
    156             if typ == mkType "Scalar::Perl5" then fmap (err $ NoSuchMethod $ show typ) (runPerl5Sub name) else do 
    157             findTypedSub typ name 
     156            if typ == mkType "Scalar::Perl5" 
     157                then do 
     158                    fmap (err $ NoSuchMethod $ show typ) (runPerl5Sub name) 
     159                else do 
     160                    findTypedSub typ name 
    158161        _ -> findBuiltinSub NoSuchSub name 
    159162    where 
     
    207210                    else canPerl5 sv "AUTOLOAD" 
    208211                if not found' 
    209                     then evalExp (App (Var name) Nothing (map (Val . PerlSV) (sv:svs))) 
     212                    then do 
     213                        -- XXX - when svs is empty, this could call back here infinitely 
     214                        --       add an extra '&' to force no-reinterpretation. 
     215                        evalExp (App (Var ('&':name)) Nothing (map (Val . PerlSV) (sv:svs))) 
    210216                    else do 
    211217                        subSV   <- liftIO . vstrToSV $ tail name