Avoid stack overflow in js_EmitTree on long left-associative operator chains (98901, r=jband, sr=shaver).

This commit is contained in:
brendan@mozilla.org
2001-10-27 18:38:16 +00:00
parent 8c7aeb3dcc
commit b9f9a8f7d7
6 changed files with 108 additions and 63 deletions

View File

@@ -85,6 +85,7 @@ typedef enum JSOp {
#define JOF_ASSIGNING 0x2000 /* hint for JSClass.resolve, used for ops
that do simplex assignment */
#define JOF_BACKPATCH 0x4000 /* backpatch placeholder during codegen */
#define JOF_LEFTASSOC 0x8000 /* left-associative operator */
#define JOF_TYPE_IS_EXTENDED_JUMP(t) \
((unsigned)((t) - JOF_JUMPX) <= (unsigned)(JOF_LOOKUPSWITCHX - JOF_JUMPX))