"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:
marcobaye
2025-06-23 10:46:15 +00:00
parent c5819c02a2
commit e1ea89bdb9
+31 -3
View File
@@ -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