mirror of
https://github.com/uffejakobsen/acme.git
synced 2026-04-20 22:16:38 +00:00
"fix" for previous commit
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@442 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
;ACME 0.97
|
||||
|
||||
; this macro calls itself ten times with a decreased "depth" value
|
||||
; "denial of service", first try:
|
||||
|
||||
; this macro calls itself ten times with a decreased "depth" value.
|
||||
; because each macro call gets its own symbols, this takes not only
|
||||
; time, but also a lot of memory:
|
||||
!macro dos @depth {
|
||||
!if @depth > 0 {
|
||||
!for @i, 0, 9 {
|
||||
@@ -15,6 +19,30 @@
|
||||
; +dos 3 ; returns immediately
|
||||
; +dos 4 ; returns immediately
|
||||
; +dos 5 ; takes <1s
|
||||
+dos 6 ; takes a few seconds
|
||||
; +dos 7 ; this takes longer...
|
||||
; +dos 6 ; takes a few seconds
|
||||
; +dos 7 ; may take 30 minutes...
|
||||
; +dos 8 ; don't do this
|
||||
|
||||
|
||||
; "denial of service", second try:
|
||||
|
||||
; this uses global symbols and therefore only takes time:
|
||||
!macro dos2 {
|
||||
!if depth > 0 {
|
||||
!set depth = depth - 1
|
||||
+dos2 : +dos2 : +dos2 : +dos2 : +dos2
|
||||
+dos2 : +dos2 : +dos2 : +dos2 : +dos2
|
||||
!set depth = depth + 1
|
||||
}
|
||||
}
|
||||
|
||||
; depths 0..4 return immediately,
|
||||
; 5 takes .2s
|
||||
; 6 takes 2s
|
||||
; 7 takes 20s
|
||||
; 8 takes about 3 minutes
|
||||
; 9 may take 30 minutes...
|
||||
; etc. pp.
|
||||
!set depth = 8
|
||||
+dos2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user