Yoko

All sides of Injection
It is currently 2025-11-06 03:08:25

All times are UTC+02:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 2008-01-06 15:47:45 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
Code:
sub fun_false()
   uo.print("fun_false")
   return 0
end sub
sub fun_true()
   uo.print("fun_true")
   return 1
end sub
sub test()
   uo.print("while false and true")
   while fun_false() and fun_true()
      uo.print("Yes")
   wend
   uo.print("while true and false")
   while fun_false() and fun_true()
      uo.print("Yes")
   wend
   uo.print("while false and false")
   while fun_false() and fun_false()
      uo.print("Yes")
   wend
end sub

Предлагаю проанализировать выше предложеный скрипт;) Ваши мысли?;)


Top
   
 Post subject:
PostPosted: 2008-01-06 16:21:54 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Моя мысль, что если хоть один из циклов вдруг заработает, то его никто не остановит..

Проверить не на чем, хоть сказал бы, какой результат от выполнения такого скрипта..

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2008-01-06 16:28:10 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
проблема в обработки условий. а именно что сначала вы полняется все что на писано в условии а потом только идет проверка на результат. тоесть если будет конструкция
Code:
while (j < len(subStr)) and (Source[i+j] == subStr[j])
j = j+1
wend

то мы волей не волей создаем условие выхода за границу массаива subStr, так как будет отработано subStr[len(subStr)]. Ничего хорошего в общем... В трезвых компилятора такая ситуация не возможна.


Top
   
 Post subject:
PostPosted: 2008-01-07 02:15:15 
Offline
Expert!
User avatar

Joined: 2005-05-20 20:30:10
Posts: 548
имхо проблема не столько компилятора, сколько языка..
инжектовский бейсик высокоуровневый язык как-никак поэтому и допускает вообще существование таких страшных конструкций...

_________________
"плагины" для инжекта


Top
   
 Post subject:
PostPosted: 2008-01-07 09:13:35 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
Причем тут это???? Тут нарушена логика выполнения дерева в логических операторах!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited