Skip to content
Snippets Groups Projects
  • Erwan Jahier's avatar
    0f54289a
    Fix a bug in the fresh var names generation. · 0f54289a
    Erwan Jahier authored
    cf test/should_work/NONREG/fresh_name.lus
    
    where the local variable _n1e1_1 was defined twice !
    
    The fix contist the following idea : prefix fresh var name by "_",
       except if at least one user ident begins by "_". In that case, we
       try to prefix them by "_1", and then "_2", and so on. We take the
       first possible one.
    
       nb : this won't work if the user defined idents from "_1" to
       "_1073741823" (on 32-bits machine), but I bet that this compiler
       would die before anyway...
    0f54289a
    History
    Fix a bug in the fresh var names generation.
    Erwan Jahier authored
    cf test/should_work/NONREG/fresh_name.lus
    
    where the local variable _n1e1_1 was defined twice !
    
    The fix contist the following idea : prefix fresh var name by "_",
       except if at least one user ident begins by "_". In that case, we
       try to prefix them by "_1", and then "_2", and so on. We take the
       first possible one.
    
       nb : this won't work if the user defined idents from "_1" to
       "_1073741823" (on 32-bits machine), but I bet that this compiler
       would die before anyway...