w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

codegen.c
Go to the documentation of this file.
1 /*
2 ** codegen.c - mruby code generator
3 **
4 ** See Copyright Notice in mruby.h
5 */
6 
7 #include <ctype.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <math.h>
11 #include <mruby.h>
12 #include <mruby/compile.h>
13 #include <mruby/proc.h>
14 #include <mruby/dump.h>
15 #include <mruby/numeric.h>
16 #include <mruby/string.h>
17 #include <mruby/debug.h>
18 #include <mruby/presym.h>
19 #include "node.h"
20 #include <mruby/opcode.h>
21 #include <mruby/re.h>
22 #include <mruby/throw.h>
23 
24 #ifndef MRB_CODEGEN_LEVEL_MAX
25 #define MRB_CODEGEN_LEVEL_MAX 1024
26 #endif
27 
28 #define MAXARG_S (1<<16)
29 
31 typedef struct mrb_parser_state parser_state;
32 
33 enum looptype {
39 };
40 
41 struct loopinfo {
42  enum looptype type;
44  int acc;
45  struct loopinfo *prev;
46 };
47 
48 typedef struct scope {
51  struct mrb_jmpbuf jmp;
52 
53  struct scope *prev;
54 
55  node *lv;
56 
61  int ainfo:15;
63 
64  struct loopinfo *loop;
67 
71 
78 
81  int ai;
82 
86 
87  int rlev; /* recursion levels */
89 
91 static void scope_finish(codegen_scope *s);
92 static struct loopinfo *loop_push(codegen_scope *s, enum looptype t);
93 static void loop_break(codegen_scope *s, node *tree);
94 static void loop_pop(codegen_scope *s, int val);
95 
96 /*
97  * The search for catch handlers starts at the end of the table in mrb_vm_run().
98  * Therefore, the next handler to be added must meet one of the following conditions.
99  * - Larger start position
100  * - Same start position but smaller end position
101  */
102 static int catch_handler_new(codegen_scope *s);
104 
105 static void gen_assignment(codegen_scope *s, node *tree, int sp, int val);
106 static void gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val);
107 
108 static void codegen(codegen_scope *s, node *tree, int val);
109 static void raise_error(codegen_scope *s, const char *msg);
110 
111 static void
113 {
114  if (!s) return;
115  while (s->prev) {
116  codegen_scope *tmp = s->prev;
117  if (s->irep) {
118  mrb_free(s->mrb, s->iseq);
119  for (int i=0; i<s->irep->plen; i++) {
120  mrb_pool_value *pv = &s->pool[i];
121  if ((pv->tt & 0x3) == IREP_TT_STR) {
122  mrb_free(s->mrb, (void*)pv->u.str);
123  }
124  }
125  mrb_free(s->mrb, s->pool);
126  mrb_free(s->mrb, s->syms);
127  mrb_free(s->mrb, s->catch_table);
128  if (s->reps) {
129  /* copied from mrb_irep_free() in state.c */
130  for (int i=0; i<s->irep->rlen; i++) {
131  if (s->reps[i])
132  mrb_irep_decref(s->mrb, (mrb_irep*)s->reps[i]);
133  }
134  mrb_free(s->mrb, s->reps);
135  }
136  mrb_free(s->mrb, s->lines);
137  }
138  mrb_pool_close(s->mpool);
139  s = tmp;
140  }
141 #ifndef MRB_NO_STDIO
142  if (s->filename_sym && s->lineno) {
143  const char *filename = mrb_sym_name_len(s->mrb, s->filename_sym, NULL);
144  fprintf(stderr, "codegen error:%s:%d: %s\n", filename, s->lineno, message);
145  }
146  else {
147  fprintf(stderr, "codegen error: %s\n", message);
148  }
149 #endif
150  MRB_THROW(&s->jmp);
151 }
152 
153 static void*
155 {
156  void *p = mrb_pool_alloc(s->mpool, len);
157 
158  if (!p) codegen_error(s, "pool memory allocation");
159  return p;
160 }
161 
162 static void*
164 {
165  p = mrb_realloc_simple(s->mrb, p, len);
166 
167  if (!p && len > 0) codegen_error(s, "mrb_realloc");
168  return p;
169 }
170 
171 static int
173 {
174  return s->lastlabel = s->pc;
175 }
176 
177 static void
179 {
180  if (pc >= s->icapa) {
181  if (pc == UINT32_MAX) {
182  codegen_error(s, "too big code block");
183  }
184  if (pc >= UINT32_MAX / 2) {
185  pc = UINT32_MAX;
186  }
187  else {
188  s->icapa *= 2;
189  }
190  s->iseq = (mrb_code *)codegen_realloc(s, s->iseq, sizeof(mrb_code)*s->icapa);
191  if (s->lines) {
192  s->lines = (uint16_t*)codegen_realloc(s, s->lines, sizeof(uint16_t)*s->icapa);
193  }
194  }
195  if (s->lines) {
196  if (s->lineno > 0 || pc == 0)
197  s->lines[pc] = s->lineno;
198  else
199  s->lines[pc] = s->lines[pc-1];
200  }
201  s->iseq[pc] = i;
202 }
203 
204 static void
206 {
207  uint8_t hi = i>>8;
208  uint8_t lo = i&0xff;
209 
210  emit_B(s, pc, hi);
211  emit_B(s, pc+1, lo);
212 }
213 
214 static void
216 {
217  emit_B(s, s->pc, i);
218  s->pc++;
219 }
220 
221 static void
223 {
224  emit_S(s, s->pc, i);
225  s->pc += 2;
226 }
227 
228 static void
230 {
231  s->lastpc = s->pc;
232  gen_B(s, i);
233 }
234 
235 static void
237 {
238  s->lastpc = s->pc;
239  if (a > 0xff) {
240  codegen_error(s, "too big operand");
241  }
242  else {
243  gen_B(s, i);
244  gen_B(s, (uint8_t)a);
245  }
246 }
247 
248 static void
250 {
251  s->lastpc = s->pc;
252  if (a > 0xff || b > 0xff) {
253  codegen_error(s, "too big operand");
254  }
255  else {
256  gen_B(s, i);
257  gen_B(s, (uint8_t)a);
258  gen_B(s, (uint8_t)b);
259  }
260 }
261 
262 /* similar to `genop_2` but generate `genop_2S` with `i+1` */
263 /* works for OP_LOADL, OP_LOADSYM, OP_STRING */
264 static void
266 {
267  s->lastpc = s->pc;
268  if (a > 0xff || b > 0xffff) {
269  codegen_error(s, "too big operand");
270  }
271  if (b > 0xff) {
272  gen_B(s, i+1);
273  gen_B(s, (uint8_t)a);
274  gen_S(s, b);
275  }
276  else {
277  gen_B(s, i);
278  gen_B(s, (uint8_t)a);
279  gen_B(s, (uint8_t)b);
280  }
281 }
282 
283 static void
285 {
286  genop_2(s, i, a, b);
287  gen_B(s, c);
288 }
289 
290 static void
292 {
293  genop_1(s, i, a);
294  gen_S(s, b);
295 }
296 
297 static void
299 {
300  genop_1(s, i, a);
301  gen_S(s, b>>16);
302  gen_S(s, b&0xffff);
303 }
304 
305 static void
307 {
308  uint8_t a1 = (a>>16) & 0xff;
309  uint8_t a2 = (a>>8) & 0xff;
310  uint8_t a3 = a & 0xff;
311 
312  s->lastpc = s->pc;
313  gen_B(s, i);
314  gen_B(s, a1);
315  gen_B(s, a2);
316  gen_B(s, a3);
317 }
318 
319 #define NOVAL 0
320 #define VAL 1
321 
322 static mrb_bool
324 {
325  if (s && s->parser && s->parser->no_optimize)
326  return TRUE;
327  return FALSE;
328 }
329 
330 struct mrb_insn_data
332 {
333  struct mrb_insn_data data = { 0 };
334  mrb_code insn = READ_B();
335  uint16_t a = 0;
336  uint16_t b = 0;
337  uint16_t c = 0;
338 
339  switch (insn) {
340 #define FETCH_Z() /* empty */
341 #define OPCODE(i,x) case OP_ ## i: FETCH_ ## x (); break;
342 #include "mruby/ops.h"
343 #undef OPCODE
344  default:
345  break;
346  }
347  data.insn = insn;
348  data.a = a;
349  data.b = b;
350  data.c = c;
351  return data;
352 }
353 
354 static struct mrb_insn_data
356 {
357  if (s->pc == s->lastpc) {
358  struct mrb_insn_data data;
359 
360  data.insn = OP_NOP;
361  return data;
362  }
363  return mrb_decode_insn(&s->iseq[s->lastpc]);
364 }
365 
366 static mrb_bool
368 {
369  return no_optimize(s) || s->lastlabel == s->pc || s->pc == 0 || s->pc == s->lastpc;
370 }
371 
372 #define JMPLINK_START UINT32_MAX
373 
374 static void
376 {
377 
378  if (pc == JMPLINK_START) {
379  gen_S(s, 0);
380  }
381  else {
382  uint32_t pos2 = s->pc+2;
383  int32_t off = pc - pos2;
384 
385  if (off > INT16_MAX || INT16_MIN > off) {
386  codegen_error(s, "too big jump offset");
387  }
388  gen_S(s, (uint16_t)off);
389  }
390 }
391 
392 static uint32_t
394 {
395  uint32_t pos;
396 
397  s->lastpc = s->pc;
398  gen_B(s, i);
399  pos = s->pc;
400  gen_jmpdst(s, pc);
401  return pos;
402 }
403 
404 #define genjmp_0(s,i) genjmp(s,i,JMPLINK_START)
405 
406 static uint32_t
408 {
409  uint32_t pos;
410 
411  if (!no_peephole(s) && !val) {
412  struct mrb_insn_data data = mrb_last_insn(s);
413 
414  if (data.insn == OP_MOVE && data.a == a) {
415  s->pc = s->lastpc;
416  a = data.b;
417  }
418  }
419 
420  s->lastpc = s->pc;
421  if (a > 0xff) {
422  codegen_error(s, "too big operand");
423  pos = 0;
424  }
425  else {
426  gen_B(s, i);
427  gen_B(s, (uint8_t)a);
428  pos = s->pc;
429  gen_jmpdst(s, pc);
430  }
431  return pos;
432 }
433 
434 #define genjmp2_0(s,i,a,val) genjmp2(s,i,a,JMPLINK_START,val)
435 
436 static void
438 {
439  if (no_peephole(s)) {
440  normal:
441  genop_2(s, OP_MOVE, dst, src);
442  return;
443  }
444  else {
445  struct mrb_insn_data data = mrb_last_insn(s);
446 
447  switch (data.insn) {
448  case OP_MOVE:
449  if (dst == src) return; /* remove useless MOVE */
450  if (data.b == dst && data.a == src) /* skip swapping MOVE */
451  return;
452  goto normal;
453  case OP_LOADNIL: case OP_LOADSELF: case OP_LOADT: case OP_LOADF:
454  case OP_LOADI__1:
455  case OP_LOADI_0: case OP_LOADI_1: case OP_LOADI_2: case OP_LOADI_3:
456  case OP_LOADI_4: case OP_LOADI_5: case OP_LOADI_6: case OP_LOADI_7:
457  if (nopeep || data.a != src || data.a < s->nlocals) goto normal;
458  s->pc = s->lastpc;
459  genop_1(s, data.insn, dst);
460  break;
461  case OP_LOADI: case OP_LOADINEG:
462  case OP_LOADL: case OP_LOADSYM:
463  case OP_LOADL16: case OP_LOADSYM16:
464  case OP_GETGV: case OP_GETSV: case OP_GETIV: case OP_GETCV:
465  case OP_GETCONST: case OP_STRING: case OP_STRING16:
466  case OP_LAMBDA: case OP_BLOCK: case OP_METHOD: case OP_BLKPUSH:
467  case OP_LAMBDA16: case OP_BLOCK16: case OP_METHOD16:
468  if (nopeep || data.a != src || data.a < s->nlocals) goto normal;
469  s->pc = s->lastpc;
470  genop_2(s, data.insn, dst, data.b);
471  break;
472  default:
473  goto normal;
474  }
475  }
476 }
477 
478 static void
480 {
481  if (no_peephole(s)) {
482  genop_1(s, op, src);
483  }
484  else {
485  struct mrb_insn_data data = mrb_last_insn(s);
486 
487  if (data.insn == OP_MOVE && src == data.a) {
488  s->pc = s->lastpc;
489  genop_1(s, op, data.b);
490  }
491  else if (data.insn != OP_RETURN) {
492  genop_1(s, op, src);
493  }
494  }
495 }
496 
497 static void
499 {
500  if (no_peephole(s)) {
501  normal:
502  genop_1(s, op, dst);
503  return;
504  }
505  else {
506  struct mrb_insn_data data = mrb_last_insn(s);
507 
508  switch (data.insn) {
509  case OP_LOADI__1:
510  if (op == OP_ADD) op = OP_SUB;
511  else op = OP_ADD;
512  data.b = 1;
513  goto replace;
514  case OP_LOADI_0: case OP_LOADI_1: case OP_LOADI_2: case OP_LOADI_3:
515  case OP_LOADI_4: case OP_LOADI_5: case OP_LOADI_6: case OP_LOADI_7:
516  data.b = data.insn - OP_LOADI_0;
517  /* fall through */
518  case OP_LOADI:
519  replace:
520  if (data.b >= 128) goto normal;
521  s->pc = s->lastpc;
522  if (op == OP_ADD) {
523  genop_2(s, OP_ADDI, dst, (uint8_t)data.b);
524  }
525  else {
526  genop_2(s, OP_SUBI, dst, (uint8_t)data.b);
527  }
528  break;
529  default:
530  goto normal;
531  }
532  }
533 }
534 
535 static uint32_t
537 {
538  int32_t pos1;
539  int32_t offset;
540  int16_t newpos;
541 
542  if (pos0 == JMPLINK_START) return 0;
543 
544  pos1 = pos0 + 2;
545  offset = s->pc - pos1;
546  if (offset > INT16_MAX) {
547  codegen_error(s, "too big jmp offset");
548  }
549  s->lastlabel = s->pc;
550  newpos = (int16_t)PEEK_S(s->iseq+pos0);
551  emit_S(s, pos0, (uint16_t)offset);
552  if (newpos == 0) return 0;
553  return pos1+newpos;
554 }
555 
556 static void
558 {
559  if (pos==JMPLINK_START) return;
560  for (;;) {
561  pos = dispatch(s, pos);
562  if (pos==0) break;
563  }
564 }
565 
566 #define nregs_update do {if (s->sp > s->nregs) s->nregs = s->sp;} while (0)
567 static void
569 {
570  if (s->sp+n >= 0xffff) {
571  codegen_error(s, "too complex expression");
572  }
573  s->sp+=n;
574  nregs_update;
575 }
576 
577 static void
579 {
580  if ((int)s->sp-n < 0) {
581  codegen_error(s, "stack pointer underflow");
582  }
583  s->sp-=n;
584 }
585 
586 #define push() push_n_(s,1)
587 #define push_n(n) push_n_(s,n)
588 #define pop() pop_n_(s,1)
589 #define pop_n(n) pop_n_(s,n)
590 #define cursp() (s->sp)
591 
592 static inline int
594 {
595  int i;
596  mrb_pool_value *pv;
597 
598  switch (mrb_type(val)) {
599  case MRB_TT_STRING:
600  for (i=0; i<s->irep->plen; i++) {
601  mrb_int len;
602  pv = &s->pool[i];
603  if (pv->tt & IREP_TT_NFLAG) continue;
604  len = pv->tt>>2;
605  if (RSTRING_LEN(val) != len) continue;
606  if (memcmp(pv->u.str, RSTRING_PTR(val), len) == 0)
607  return i;
608  }
609  break;
610 #ifndef MRB_NO_FLOAT
611  case MRB_TT_FLOAT:
612  for (i=0; i<s->irep->plen; i++) {
613  mrb_float f1, f2;
614  pv = &s->pool[i];
615  if (pv->tt != IREP_TT_FLOAT) continue;
616  pv = &s->pool[i];
617  f1 = pv->u.f;
618  f2 = mrb_float(val);
619  if (f1 == f2 && !signbit(f1) == !signbit(f2)) return i;
620  }
621  break;
622 #endif
623  case MRB_TT_INTEGER:
624  for (i=0; i<s->irep->plen; i++) {
626  pv = &s->pool[i];
627  if (pv->tt == IREP_TT_INT32) {
628  if (v == pv->u.i32) return i;
629  }
630 #ifdef MRB_64BIT
631  else if (pv->tt == IREP_TT_INT64) {
632  if (v == pv->u.i64) return i;
633  }
634  continue;
635 #endif
636  }
637  break;
638  default:
639  /* should not happen */
640  return 0;
641  }
642 
643  if (s->irep->plen == s->pcapa) {
644  s->pcapa *= 2;
645  s->pool = (mrb_pool_value*)codegen_realloc(s, s->pool, sizeof(mrb_pool_value)*s->pcapa);
646  }
647 
648  pv = &s->pool[s->irep->plen];
649  i = s->irep->plen++;
650 
651  switch (mrb_type(val)) {
652  case MRB_TT_STRING:
653  if (RSTR_NOFREE_P(RSTRING(val))) {
654  pv->tt = (uint32_t)(RSTRING_LEN(val)<<2) | IREP_TT_SSTR;
655  pv->u.str = RSTRING_PTR(val);
656  }
657  else {
658  char *p;
660  pv->tt = (uint32_t)(len<<2) | IREP_TT_STR;
661  p = (char*)codegen_realloc(s, NULL, len+1);
662  memcpy(p, RSTRING_PTR(val), len);
663  p[len] = '\0';
664  pv->u.str = p;
665  }
666  break;
667 
668 #ifndef MRB_NO_FLOAT
669  case MRB_TT_FLOAT:
670  pv->tt = IREP_TT_FLOAT;
671  pv->u.f = mrb_float(val);
672  break;
673 #endif
674  case MRB_TT_INTEGER:
675 #ifdef MRB_INT64
676  pv->tt = IREP_TT_INT64;
677  pv->u.i64 = mrb_integer(val);
678 #else
679  pv->tt = IREP_TT_INT32;
680  pv->u.i32 = mrb_integer(val);
681 #endif
682  break;
683 
684  default:
685  /* should not happen */
686  break;
687  }
688  return i;
689 }
690 
691 static int
693 {
694  int i, len;
695 
696  mrb_assert(s->irep);
697 
698  len = s->irep->slen;
699  for (i=0; i<len; i++) {
700  if (s->syms[i] == sym) return i;
701  }
702  if (s->irep->slen >= s->scapa) {
703  s->scapa *= 2;
704  if (s->scapa > 0xffff) {
705  codegen_error(s, "too many symbols");
706  }
707  s->syms = (mrb_sym*)codegen_realloc(s, s->syms, sizeof(mrb_sym)*s->scapa);
708  }
709  s->syms[s->irep->slen] = sym;
710  return s->irep->slen++;
711 }
712 
713 static int
715 {
716  int n = 0;
717 
718  while (tree) {
719  n++;
720  tree = tree->cdr;
721  }
722  return n;
723 }
724 
725 #define nint(x) ((int)(intptr_t)(x))
726 #define nchar(x) ((char)(intptr_t)(x))
727 #define nsym(x) ((mrb_sym)(intptr_t)(x))
728 
729 #define lv_name(lv) nsym((lv)->car)
730 
731 static int
733 {
734  node *lv = s->lv;
735  int n = 1;
736 
737  while (lv) {
738  if (lv_name(lv) == id) return n;
739  n++;
740  lv = lv->cdr;
741  }
742  return 0;
743 }
744 
745 static int
747 {
748  const struct RProc *u;
749  int lv = 0;
750  codegen_scope *up = s->prev;
751 
752  while (up) {
753  *idx = lv_idx(up, id);
754  if (*idx > 0) {
755  return lv;
756  }
757  lv ++;
758  up = up->prev;
759  }
760 
761  if (lv < 1) lv = 1;
762  u = s->parser->upper;
763  while (u && !MRB_PROC_CFUNC_P(u)) {
764  const struct mrb_irep *ir = u->body.irep;
765  uint_fast16_t n = ir->nlocals;
766  int i;
767 
768  const mrb_sym *v = ir->lv;
769  for (i=1; n > 1; n--, v++, i++) {
770  if (*v == id) {
771  *idx = i;
772  return lv - 1;
773  }
774  }
775  if (MRB_PROC_SCOPE_P(u)) break;
776  u = u->upper;
777  lv ++;
778  }
779 
780  codegen_error(s, "Can't found local variables");
781  return -1; /* not reached */
782 }
783 
784 static void
786 {
787  codegen_scope *prev = s;
788  int idx;
789  struct loopinfo *lp;
790  node *n2;
791 
792  /* generate receiver */
793  codegen(s, tree->cdr->car, VAL);
794  /* generate loop-block */
795  s = scope_new(s->mrb, s, NULL);
796 
797  push(); /* push for a block parameter */
798 
799  /* generate loop variable */
800  n2 = tree->car;
801  genop_W(s, OP_ENTER, 0x40000);
802  if (n2->car && !n2->car->cdr && !n2->cdr) {
803  gen_assignment(s, n2->car->car, 1, NOVAL);
804  }
805  else {
806  gen_vmassignment(s, n2, 1, VAL);
807  }
808  /* construct loop */
809  lp = loop_push(s, LOOP_FOR);
810  lp->pc2 = new_label(s);
811 
812  /* loop body */
813  codegen(s, tree->cdr->cdr->car, VAL);
814  pop();
816  loop_pop(s, NOVAL);
817  scope_finish(s);
818  s = prev;
819  genop_2(s, OP_BLOCK, cursp(), s->irep->rlen-1);
820  push();pop(); /* space for a block */
821  pop();
822  idx = new_sym(s, MRB_SYM_2(s->mrb, each));
823  genop_3(s, OP_SENDB, cursp(), idx, 0);
824 }
825 
826 static int
827 lambda_body(codegen_scope *s, node *tree, int blk)
828 {
830  s = scope_new(s->mrb, s, tree->car);
831 
832  s->mscope = !blk;
833 
834  if (blk) {
835  struct loopinfo *lp = loop_push(s, LOOP_BLOCK);
836  lp->pc0 = new_label(s);
837  }
838  tree = tree->cdr;
839  if (tree->car == NULL) {
840  genop_W(s, OP_ENTER, 0);
841  }
842  else {
843  mrb_aspec a;
844  int ma, oa, ra, pa, ka, kd, ba;
845  int pos, i;
846  node *opt;
847  node *margs, *pargs;
848  node *tail;
849 
850  /* mandatory arguments */
851  ma = node_len(tree->car->car);
852  margs = tree->car->car;
853  tail = tree->car->cdr->cdr->cdr->cdr;
854 
855  /* optional arguments */
856  oa = node_len(tree->car->cdr->car);
857  /* rest argument? */
858  ra = tree->car->cdr->cdr->car ? 1 : 0;
859  /* mandatory arguments after rest argument */
860  pa = node_len(tree->car->cdr->cdr->cdr->car);
861  pargs = tree->car->cdr->cdr->cdr->car;
862  /* keyword arguments */
863  ka = tail? node_len(tail->cdr->car) : 0;
864  /* keyword dictionary? */
865  kd = tail && tail->cdr->cdr->car? 1 : 0;
866  /* block argument? */
867  ba = tail && tail->cdr->cdr->cdr->car ? 1 : 0;
868 
869  if (ma > 0x1f || oa > 0x1f || pa > 0x1f || ka > 0x1f) {
870  codegen_error(s, "too many formal arguments");
871  }
872  a = MRB_ARGS_REQ(ma)
873  | MRB_ARGS_OPT(oa)
874  | (ra? MRB_ARGS_REST() : 0)
875  | MRB_ARGS_POST(pa)
876  | MRB_ARGS_KEY(ka, kd)
877  | (ba? MRB_ARGS_BLOCK() : 0);
878  s->ainfo = (((ma+oa) & 0x3f) << 7) /* (12bits = 5:1:5:1) */
879  | ((ra & 0x1) << 6)
880  | ((pa & 0x1f) << 1)
881  | ((ka | kd) != 0 ? 0x01 : 0x00);
882  genop_W(s, OP_ENTER, a);
883  /* generate jump table for optional arguments initializer */
884  pos = new_label(s);
885  for (i=0; i<oa; i++) {
886  new_label(s);
887  genjmp_0(s, OP_JMP);
888  }
889  if (oa > 0) {
890  genjmp_0(s, OP_JMP);
891  }
892  opt = tree->car->cdr->car;
893  i = 0;
894  while (opt) {
895  int idx;
896  mrb_sym id = nsym(opt->car->car);
897 
898  dispatch(s, pos+i*3+1);
899  codegen(s, opt->car->cdr, VAL);
900  pop();
901  idx = lv_idx(s, id);
902  if (idx > 0) {
903  gen_move(s, idx, cursp(), 0);
904  }
905  else {
906  int lv = search_upvar(s, id, &idx);
907  genop_3(s, OP_GETUPVAR, cursp(), idx, lv);
908  }
909  i++;
910  opt = opt->cdr;
911  }
912  if (oa > 0) {
913  dispatch(s, pos+i*3+1);
914  }
915 
916  /* keyword arguments */
917  if (tail) {
918  node *kwds = tail->cdr->car;
919  int kwrest = 0;
920 
921  if (tail->cdr->cdr->car) {
922  kwrest = 1;
923  }
925  mrb_assert(node_len(tail) == 4);
926 
927  while (kwds) {
928  int jmpif_key_p, jmp_def_set = -1;
929  node *kwd = kwds->car, *def_arg = kwd->cdr->cdr->car;
930  mrb_sym kwd_sym = nsym(kwd->cdr->car);
931 
932  mrb_assert(nint(kwd->car) == NODE_KW_ARG);
933 
934  if (def_arg) {
935  int idx;
936  genop_2(s, OP_KEY_P, lv_idx(s, kwd_sym), new_sym(s, kwd_sym));
937  jmpif_key_p = genjmp2_0(s, OP_JMPIF, lv_idx(s, kwd_sym), NOVAL);
938  codegen(s, def_arg, VAL);
939  pop();
940  idx = lv_idx(s, kwd_sym);
941  if (idx > 0) {
942  gen_move(s, idx, cursp(), 0);
943  }
944  else {
945  int lv = search_upvar(s, kwd_sym, &idx);
946  genop_3(s, OP_GETUPVAR, cursp(), idx, lv);
947  }
948  jmp_def_set = genjmp_0(s, OP_JMP);
949  dispatch(s, jmpif_key_p);
950  }
951  genop_2(s, OP_KARG, lv_idx(s, kwd_sym), new_sym(s, kwd_sym));
952  if (jmp_def_set != -1) {
953  dispatch(s, jmp_def_set);
954  }
955  i++;
956 
957  kwds = kwds->cdr;
958  }
959  if (tail->cdr->car && !kwrest) {
960  genop_0(s, OP_KEYEND);
961  }
962  }
963 
964  /* argument destructuring */
965  if (margs) {
966  node *n = margs;
967 
968  pos = 1;
969  while (n) {
970  if (nint(n->car->car) == NODE_MASGN) {
971  gen_vmassignment(s, n->car->cdr->car, pos, NOVAL);
972  }
973  pos++;
974  n = n->cdr;
975  }
976  }
977  if (pargs) {
978  node *n = margs;
979 
980  pos = ma+oa+ra+1;
981  while (n) {
982  if (nint(n->car->car) == NODE_MASGN) {
983  gen_vmassignment(s, n->car->cdr->car, pos, NOVAL);
984  }
985  pos++;
986  n = n->cdr;
987  }
988  }
989  }
990 
991  codegen(s, tree->cdr->car, VAL);
992  pop();
993  if (s->pc > 0) {
995  }
996  if (blk) {
997  loop_pop(s, NOVAL);
998  }
999  scope_finish(s);
1000  return parent->irep->rlen - 1;
1001 }
1002 
1003 static int
1005 {
1006  codegen_scope *scope = scope_new(s->mrb, s, tree->car);
1007 
1008  codegen(scope, tree->cdr, VAL);
1010  if (!s->iseq) {
1011  genop_0(scope, OP_STOP);
1012  }
1014  if (!s->irep) {
1015  /* should not happen */
1016  return 0;
1017  }
1018  return s->irep->rlen - 1;
1019 }
1020 
1021 static mrb_bool
1023 {
1024  while (t) {
1025  if (nint(t->car->car) == NODE_SPLAT) return FALSE;
1026  t = t->cdr;
1027  }
1028  return TRUE;
1029 }
1030 
1031 static mrb_sym
1033 {
1034  const char *name;
1035  mrb_int len;
1036  char *name2;
1037 
1038  name = mrb_sym_name_len(s->mrb, a, &len);
1039  name2 = (char *)codegen_palloc(s,
1040  (size_t)len
1041  + 1 /* '=' */
1042  + 1 /* '\0' */
1043  );
1045  memcpy(name2, name, (size_t)len);
1046  name2[len] = '=';
1047  name2[len+1] = '\0';
1048 
1049  return mrb_intern(s->mrb, name2, len+1);
1050 }
1051 
1052 #define CALL_MAXARGS 127
1053 
1054 static int
1055 gen_values(codegen_scope *s, node *t, int val, int extra)
1056 {
1057  int n = 0;
1058  int is_splat;
1059 
1060  while (t) {
1061  is_splat = nint(t->car->car) == NODE_SPLAT; /* splat mode */
1062  if (
1063  n+extra >= CALL_MAXARGS - 1 /* need to subtract one because vm.c expects an array if n == CALL_MAXARGS */
1064  || is_splat) {
1065  if (val) {
1066  if (is_splat && n == 0 && nint(t->car->cdr->car) == NODE_ARRAY) {
1067  codegen(s, t->car->cdr, VAL);
1068  pop();
1069  }
1070  else {
1071  pop_n(n);
1072  if (n == 0 && is_splat) {
1073  genop_1(s, OP_LOADNIL, cursp());
1074  }
1075  else {
1076  genop_2(s, OP_ARRAY, cursp(), n);
1077  }
1078  push();
1079  codegen(s, t->car, VAL);
1080  pop(); pop();
1081  if (is_splat) {
1082  genop_1(s, OP_ARYCAT, cursp());
1083  }
1084  else {
1085  genop_1(s, OP_ARYPUSH, cursp());
1086  }
1087  }
1088  t = t->cdr;
1089  while (t) {
1090  push();
1091  codegen(s, t->car, VAL);
1092  pop(); pop();
1093  if (nint(t->car->car) == NODE_SPLAT) {
1094  genop_1(s, OP_ARYCAT, cursp());
1095  }
1096  else {
1097  genop_1(s, OP_ARYPUSH, cursp());
1098  }
1099  t = t->cdr;
1100  }
1101  }
1102  else {
1103  while (t) {
1104  codegen(s, t->car, NOVAL);
1105  t = t->cdr;
1106  }
1107  }
1108  return -1;
1109  }
1110  /* normal (no splat) mode */
1111  codegen(s, t->car, val);
1112  n++;
1113  t = t->cdr;
1114  }
1115  return n;
1116 }
1117 
1118 static void
1119 gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe)
1120 {
1121  mrb_sym sym = name ? name : nsym(tree->cdr->car);
1122  int skip = 0;
1123  int n = 0, noop = 0, sendv = 0, blk = 0;
1124 
1125  codegen(s, tree->car, VAL); /* receiver */
1126  if (safe) {
1127  int recv = cursp()-1;
1128  gen_move(s, cursp(), recv, 1);
1129  skip = genjmp2_0(s, OP_JMPNIL, cursp(), val);
1130  }
1131  tree = tree->cdr->cdr->car;
1132  if (tree) {
1133  n = gen_values(s, tree->car, VAL, sp?1:0);
1134  if (n < 0) {
1135  n = noop = sendv = 1;
1136  push();
1137  }
1138  }
1139  if (sp) { /* last argument pushed (attr=) */
1140  if (sendv) {
1141  gen_move(s, cursp(), sp, 0);
1142  pop();
1143  genop_1(s, OP_ARYPUSH, cursp());
1144  push();
1145  }
1146  else {
1147  gen_move(s, cursp(), sp, 0);
1148  push();
1149  n++;
1150  }
1151  }
1152  if (tree && tree->cdr) {
1153  noop = 1;
1154  codegen(s, tree->cdr, VAL);
1155  pop();
1156  blk = 1;
1157  }
1158  push();pop();
1159  pop_n(n+1);
1160  {
1161  mrb_int symlen;
1162  const char *symname = mrb_sym_name_len(s->mrb, sym, &symlen);
1163 
1164  if (!noop && symlen == 1 && symname[0] == '+' && n == 1) {
1165  gen_addsub(s, OP_ADD, cursp());
1166  }
1167  else if (!noop && symlen == 1 && symname[0] == '-' && n == 1) {
1168  gen_addsub(s, OP_SUB, cursp());
1169  }
1170  else if (!noop && symlen == 1 && symname[0] == '*' && n == 1) {
1171  genop_1(s, OP_MUL, cursp());
1172  }
1173  else if (!noop && symlen == 1 && symname[0] == '/' && n == 1) {
1174  genop_1(s, OP_DIV, cursp());
1175  }
1176  else if (!noop && symlen == 1 && symname[0] == '<' && n == 1) {
1177  genop_1(s, OP_LT, cursp());
1178  }
1179  else if (!noop && symlen == 2 && symname[0] == '<' && symname[1] == '=' && n == 1) {
1180  genop_1(s, OP_LE, cursp());
1181  }
1182  else if (!noop && symlen == 1 && symname[0] == '>' && n == 1) {
1183  genop_1(s, OP_GT, cursp());
1184  }
1185  else if (!noop && symlen == 2 && symname[0] == '>' && symname[1] == '=' && n == 1) {
1186  genop_1(s, OP_GE, cursp());
1187  }
1188  else if (!noop && symlen == 2 && symname[0] == '=' && symname[1] == '=' && n == 1) {
1189  genop_1(s, OP_EQ, cursp());
1190  }
1191  else {
1192  int idx = new_sym(s, sym);
1193 
1194  if (sendv) {
1195  genop_2(s, blk ? OP_SENDVB : OP_SENDV, cursp(), idx);
1196  }
1197  else {
1198  genop_3(s, blk ? OP_SENDB : OP_SEND, cursp(), idx, n);
1199  }
1200  }
1201  }
1202  if (safe) {
1203  dispatch(s, skip);
1204  }
1205  if (val) {
1206  push();
1207  }
1208 }
1209 
1210 static void
1212 {
1213  int idx;
1214  int type = nint(tree->car);
1215 
1216  tree = tree->cdr;
1217  switch (type) {
1218  case NODE_GVAR:
1219  idx = new_sym(s, nsym(tree));
1220  genop_2(s, OP_SETGV, sp, idx);
1221  break;
1222  case NODE_ARG:
1223  case NODE_LVAR:
1224  idx = lv_idx(s, nsym(tree));
1225  if (idx > 0) {
1226  if (idx != sp) {
1227  gen_move(s, idx, sp, val);
1228  }
1229  break;
1230  }
1231  else { /* upvar */
1232  int lv = search_upvar(s, nsym(tree), &idx);
1233  genop_3(s, OP_SETUPVAR, sp, idx, lv);
1234  }
1235  break;
1236  case NODE_NVAR:
1237  idx = nint(tree);
1238  codegen_error(s, "Can't assign to numbered parameter");
1239  break;
1240  case NODE_IVAR:
1241  idx = new_sym(s, nsym(tree));
1242  genop_2(s, OP_SETIV, sp, idx);
1243  break;
1244  case NODE_CVAR:
1245  idx = new_sym(s, nsym(tree));
1246  genop_2(s, OP_SETCV, sp, idx);
1247  break;
1248  case NODE_CONST:
1249  idx = new_sym(s, nsym(tree));
1250  genop_2(s, OP_SETCONST, sp, idx);
1251  break;
1252  case NODE_COLON2:
1253  gen_move(s, cursp(), sp, 0);
1254  push();
1255  codegen(s, tree->car, VAL);
1256  pop_n(2);
1257  idx = new_sym(s, nsym(tree->cdr));
1258  genop_2(s, OP_SETMCNST, sp, idx);
1259  break;
1260 
1261  case NODE_CALL:
1262  case NODE_SCALL:
1263  push();
1264  gen_call(s, tree, attrsym(s, nsym(tree->cdr->car)), sp, NOVAL,
1265  type == NODE_SCALL);
1266  pop();
1267  if (val) {
1268  gen_move(s, cursp(), sp, 0);
1269  }
1270  break;
1271 
1272  case NODE_MASGN:
1273  gen_vmassignment(s, tree->car, sp, val);
1274  break;
1275 
1276  /* splat without assignment */
1277  case NODE_NIL:
1278  break;
1279 
1280  default:
1281 #ifndef MRB_NO_STDIO
1282  fprintf(stderr, "unknown lhs %d\n", type);
1283 #endif
1284  break;
1285  }
1286  if (val) push();
1287 }
1288 
1289 static void
1290 gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
1291 {
1292  int n = 0, post = 0;
1293  node *t, *p;
1294 
1295  if (tree->car) { /* pre */
1296  t = tree->car;
1297  n = 0;
1298  while (t) {
1299  int sp = cursp();
1300 
1301  genop_3(s, OP_AREF, sp, rhs, n);
1302  push();
1303  gen_assignment(s, t->car, sp, NOVAL);
1304  pop();
1305  n++;
1306  t = t->cdr;
1307  }
1308  }
1309  t = tree->cdr;
1310  if (t) {
1311  if (t->cdr) { /* post count */
1312  p = t->cdr->car;
1313  while (p) {
1314  post++;
1315  p = p->cdr;
1316  }
1317  }
1318  gen_move(s, cursp(), rhs, val);
1319  push_n(post+1);
1320  pop_n(post+1);
1321  genop_3(s, OP_APOST, cursp(), n, post);
1322  n = 1;
1323  if (t->car && t->car != (node*)-1) { /* rest */
1324  gen_assignment(s, t->car, cursp(), NOVAL);
1325  }
1326  if (t->cdr && t->cdr->car) {
1327  t = t->cdr->car;
1328  while (t) {
1329  gen_assignment(s, t->car, cursp()+n, NOVAL);
1330  t = t->cdr;
1331  n++;
1332  }
1333  }
1334  if (val) {
1335  gen_move(s, cursp(), rhs, 0);
1336  }
1337  }
1338 }
1339 
1340 static void
1342 {
1343  pop();
1344  genop_1(s, OP_INTERN, cursp());
1345  push();
1346 }
1347 
1348 static void
1350 {
1351  if (val) {
1352  int i = 0, j = 0;
1353 
1354  while (tree) {
1355  switch (nint(tree->car->car)) {
1356  case NODE_STR:
1357  if ((tree->cdr == NULL) && (nint(tree->car->cdr->cdr) == 0))
1358  break;
1359  /* fall through */
1360  case NODE_BEGIN:
1361  codegen(s, tree->car, VAL);
1362  ++j;
1363  break;
1364 
1365  case NODE_LITERAL_DELIM:
1366  if (j > 0) {
1367  j = 0;
1368  ++i;
1369  if (sym)
1370  gen_intern(s);
1371  }
1372  break;
1373  }
1374  while (j >= 2) {
1375  pop(); pop();
1376  genop_1(s, OP_STRCAT, cursp());
1377  push();
1378  j--;
1379  }
1380  tree = tree->cdr;
1381  }
1382  if (j > 0) {
1383  ++i;
1384  if (sym)
1385  gen_intern(s);
1386  }
1387  pop_n(i);
1388  genop_2(s, OP_ARRAY, cursp(), i);
1389  push();
1390  }
1391  else {
1392  while (tree) {
1393  switch (nint(tree->car->car)) {
1394  case NODE_BEGIN: case NODE_BLOCK:
1395  codegen(s, tree->car, NOVAL);
1396  }
1397  tree = tree->cdr;
1398  }
1399  }
1400 }
1401 
1402 static void
1404 {
1405  int idx = new_lit(s, mrb_str_new_cstr(s->mrb, msg));
1406 
1407  genop_1(s, OP_ERR, idx);
1408 }
1409 
1410 static mrb_int
1412 {
1413  const char *e = p + strlen(p);
1414  mrb_int result = 0;
1415  int n;
1416 
1417  mrb_assert(base >= 2 && base <= 36);
1418  if (*p == '+') p++;
1419  while (p < e) {
1420  char c = *p;
1421  c = tolower((unsigned char)c);
1422  for (n=0; n<base; n++) {
1423  if (mrb_digitmap[n] == c) {
1424  break;
1425  }
1426  }
1427  if (n == base) {
1428  codegen_error(s, "malformed readint input");
1429  }
1430 
1431  if (neg) {
1432  if ((MRB_INT_MIN + n)/base > result) {
1433  *overflow = TRUE;
1434  return 0;
1435  }
1436  result *= base;
1437  result -= n;
1438  }
1439  else {
1440  if ((MRB_INT_MAX - n)/base < result) {
1441  *overflow = TRUE;
1442  return 0;
1443  }
1444  result *= base;
1445  result += n;
1446  }
1447  p++;
1448  }
1449  *overflow = FALSE;
1450  return result;
1451 }
1452 
1453 static void
1455 {
1456  if (nint(tree->car) == NODE_SPLAT) {
1457  codegen(s, tree, VAL);
1458  pop();
1459  genop_1(s, OP_ARYDUP, cursp());
1460  }
1461  else {
1462  codegen(s, tree, VAL);
1463  pop();
1464  }
1465 }
1466 
1467 static void
1469 {
1470  int nt;
1471  int rlev = s->rlev;
1472 
1473  if (!tree) {
1474  if (val) {
1475  genop_1(s, OP_LOADNIL, cursp());
1476  push();
1477  }
1478  return;
1479  }
1480 
1481  s->rlev++;
1482  if (s->rlev > MRB_CODEGEN_LEVEL_MAX) {
1483  codegen_error(s, "too complex expression");
1484  }
1485  if (s->irep && s->filename_index != tree->filename_index) {
1486  mrb_sym fname = mrb_parser_get_filename(s->parser, s->filename_index);
1487  const char *filename = mrb_sym_name_len(s->mrb, fname, NULL);
1488 
1489  mrb_debug_info_append_file(s->mrb, s->irep->debug_info,
1490  filename, s->lines, s->debug_start_pos, s->pc);
1491  s->debug_start_pos = s->pc;
1492  s->filename_index = tree->filename_index;
1493  s->filename_sym = mrb_parser_get_filename(s->parser, tree->filename_index);
1494  }
1495 
1496  nt = nint(tree->car);
1497  s->lineno = tree->lineno;
1498  tree = tree->cdr;
1499  switch (nt) {
1500  case NODE_BEGIN:
1501  if (val && !tree) {
1502  genop_1(s, OP_LOADNIL, cursp());
1503  push();
1504  }
1505  while (tree) {
1506  codegen(s, tree->car, tree->cdr ? NOVAL : val);
1507  tree = tree->cdr;
1508  }
1509  break;
1510 
1511  case NODE_RESCUE:
1512  {
1513  int noexc;
1514  uint32_t exend, pos1, pos2, tmp;
1515  struct loopinfo *lp;
1516  int catch_entry, begin, end;
1517 
1518  if (tree->car == NULL) goto exit;
1519  lp = loop_push(s, LOOP_BEGIN);
1520  lp->pc0 = new_label(s);
1521  catch_entry = catch_handler_new(s);
1522  begin = s->pc;
1523  codegen(s, tree->car, VAL);
1524  pop();
1525  lp->type = LOOP_RESCUE;
1526  end = s->pc;
1527  noexc = genjmp_0(s, OP_JMP);
1528  catch_handler_set(s, catch_entry, MRB_CATCH_RESCUE, begin, end, s->pc);
1529  tree = tree->cdr;
1530  exend = JMPLINK_START;
1531  pos1 = JMPLINK_START;
1532  if (tree->car) {
1533  node *n2 = tree->car;
1534  int exc = cursp();
1535 
1536  genop_1(s, OP_EXCEPT, exc);
1537  push();
1538  while (n2) {
1539  node *n3 = n2->car;
1540  node *n4 = n3->car;
1541 
1542  dispatch(s, pos1);
1543  pos2 = JMPLINK_START;
1544  do {
1545  if (n4 && n4->car && nint(n4->car->car) == NODE_SPLAT) {
1546  codegen(s, n4->car, VAL);
1547  gen_move(s, cursp(), exc, 0);
1548  push_n(2); pop_n(2); /* space for one arg and a block */
1549  pop();
1550  genop_3(s, OP_SEND, cursp(), new_sym(s, MRB_SYM_2(s->mrb, __case_eqq)), 1);
1551  }
1552  else {
1553  if (n4) {
1554  codegen(s, n4->car, VAL);
1555  }
1556  else {
1557  genop_2(s, OP_GETCONST, cursp(), new_sym(s, MRB_SYM_2(s->mrb, StandardError)));
1558  push();
1559  }
1560  pop();
1561  genop_2(s, OP_RESCUE, exc, cursp());
1562  }
1563  tmp = genjmp2(s, OP_JMPIF, cursp(), pos2, val);
1564  pos2 = tmp;
1565  if (n4) {
1566  n4 = n4->cdr;
1567  }
1568  } while (n4);
1569  pos1 = genjmp_0(s, OP_JMP);
1570  dispatch_linked(s, pos2);
1571 
1572  pop();
1573  if (n3->cdr->car) {
1574  gen_assignment(s, n3->cdr->car, exc, NOVAL);
1575  }
1576  if (n3->cdr->cdr->car) {
1577  codegen(s, n3->cdr->cdr->car, val);
1578  if (val) pop();
1579  }
1580  tmp = genjmp(s, OP_JMP, exend);
1581  exend = tmp;
1582  n2 = n2->cdr;
1583  push();
1584  }
1585  if (pos1 != JMPLINK_START) {
1586  dispatch(s, pos1);
1587  genop_1(s, OP_RAISEIF, exc);
1588  }
1589  }
1590  pop();
1591  tree = tree->cdr;
1592  dispatch(s, noexc);
1593  if (tree->car) {
1594  codegen(s, tree->car, val);
1595  }
1596  else if (val) {
1597  push();
1598  }
1599  dispatch_linked(s, exend);
1600  loop_pop(s, NOVAL);
1601  }
1602  break;
1603 
1604  case NODE_ENSURE:
1605  if (!tree->cdr || !tree->cdr->cdr ||
1606  (nint(tree->cdr->cdr->car) == NODE_BEGIN &&
1607  tree->cdr->cdr->cdr)) {
1608  int catch_entry, begin, end, target;
1609  int idx;
1610 
1611  catch_entry = catch_handler_new(s);
1612  begin = s->pc;
1613  codegen(s, tree->car, val);
1614  end = target = s->pc;
1615  push();
1616  idx = cursp();
1617  genop_1(s, OP_EXCEPT, idx);
1618  push();
1619  codegen(s, tree->cdr->cdr, NOVAL);
1620  pop();
1621  genop_1(s, OP_RAISEIF, idx);
1622  pop();
1623  catch_handler_set(s, catch_entry, MRB_CATCH_ENSURE, begin, end, target);
1624  }
1625  else { /* empty ensure ignored */
1626  codegen(s, tree->car, val);
1627  }
1628  break;
1629 
1630  case NODE_LAMBDA:
1631  if (val) {
1632  int idx = lambda_body(s, tree, 1);
1633 
1634  genop_bs(s, OP_LAMBDA, cursp(), idx);
1635  push();
1636  }
1637  break;
1638 
1639  case NODE_BLOCK:
1640  if (val) {
1641  int idx = lambda_body(s, tree, 1);
1642 
1643  genop_bs(s, OP_BLOCK, cursp(), idx);
1644  push();
1645  }
1646  break;
1647 
1648  case NODE_IF:
1649  {
1650  int pos1, pos2, nil_p = FALSE;
1651  node *elsepart = tree->cdr->cdr->car;
1652 
1653  if (!tree->car) {
1654  codegen(s, elsepart, val);
1655  goto exit;
1656  }
1657  switch (nint(tree->car->car)) {
1658  case NODE_TRUE:
1659  case NODE_INT:
1660  case NODE_STR:
1661  codegen(s, tree->cdr->car, val);
1662  goto exit;
1663  case NODE_FALSE:
1664  case NODE_NIL:
1665  codegen(s, elsepart, val);
1666  goto exit;
1667  case NODE_CALL:
1668  {
1669  node *n = tree->car->cdr;
1670  mrb_sym mid = nsym(n->cdr->car);
1671  mrb_sym mnil = MRB_SYM_Q_2(s->mrb, nil);
1672  if (mid == mnil && n->cdr->cdr->car == NULL) {
1673  nil_p = TRUE;
1674  codegen(s, n->car, VAL);
1675  }
1676  }
1677  break;
1678  }
1679  if (!nil_p) {
1680  codegen(s, tree->car, VAL);
1681  }
1682  pop();
1683  if (val || tree->cdr->car) {
1684  if (nil_p) {
1685  pos2 = genjmp2_0(s, OP_JMPNIL, cursp(), val);
1686  pos1 = genjmp_0(s, OP_JMP);
1687  dispatch(s, pos2);
1688  }
1689  else {
1690  pos1 = genjmp2_0(s, OP_JMPNOT, cursp(), val);
1691  }
1692  codegen(s, tree->cdr->car, val);
1693  if (val) pop();
1694  if (elsepart || val) {
1695  pos2 = genjmp_0(s, OP_JMP);
1696  dispatch(s, pos1);
1697  codegen(s, elsepart, val);
1698  dispatch(s, pos2);
1699  }
1700  else {
1701  dispatch(s, pos1);
1702  }
1703  }
1704  else { /* empty then-part */
1705  if (elsepart) {
1706  if (nil_p) {
1707  pos1 = genjmp2_0(s, OP_JMPNIL, cursp(), val);
1708  }
1709  else {
1710  pos1 = genjmp2_0(s, OP_JMPIF, cursp(), val);
1711  }
1712  codegen(s, elsepart, val);
1713  dispatch(s, pos1);
1714  }
1715  else if (val && !nil_p) {
1716  genop_1(s, OP_LOADNIL, cursp());
1717  push();
1718  }
1719  }
1720  }
1721  break;
1722 
1723  case NODE_AND:
1724  {
1725  int pos;
1726 
1727  codegen(s, tree->car, VAL);
1728  pop();
1729  pos = genjmp2_0(s, OP_JMPNOT, cursp(), val);
1730  codegen(s, tree->cdr, val);
1731  dispatch(s, pos);
1732  }
1733  break;
1734 
1735  case NODE_OR:
1736  {
1737  int pos;
1738 
1739  codegen(s, tree->car, VAL);
1740  pop();
1741  pos = genjmp2_0(s, OP_JMPIF, cursp(), val);
1742  codegen(s, tree->cdr, val);
1743  dispatch(s, pos);
1744  }
1745  break;
1746 
1747  case NODE_WHILE:
1748  {
1749  struct loopinfo *lp = loop_push(s, LOOP_NORMAL);
1750 
1751  lp->pc0 = new_label(s);
1752  lp->pc1 = genjmp_0(s, OP_JMP);
1753  lp->pc2 = new_label(s);
1754  codegen(s, tree->cdr, NOVAL);
1755  dispatch(s, lp->pc1);
1756  codegen(s, tree->car, VAL);
1757  pop();
1758  genjmp2(s, OP_JMPIF, cursp(), lp->pc2, NOVAL);
1759 
1760  loop_pop(s, val);
1761  }
1762  break;
1763 
1764  case NODE_UNTIL:
1765  {
1766  struct loopinfo *lp = loop_push(s, LOOP_NORMAL);
1767 
1768  lp->pc0 = new_label(s);
1769  lp->pc1 = genjmp_0(s, OP_JMP);
1770  lp->pc2 = new_label(s);
1771  codegen(s, tree->cdr, NOVAL);
1772  dispatch(s, lp->pc1);
1773  codegen(s, tree->car, VAL);
1774  pop();
1775  genjmp2(s, OP_JMPNOT, cursp(), lp->pc2, NOVAL);
1776 
1777  loop_pop(s, val);
1778  }
1779  break;
1780 
1781  case NODE_FOR:
1782  for_body(s, tree);
1783  if (val) push();
1784  break;
1785 
1786  case NODE_CASE:
1787  {
1788  int head = 0;
1789  uint32_t pos1, pos2, pos3, tmp;
1790  node *n;
1791 
1792  pos3 = JMPLINK_START;
1793  if (tree->car) {
1794  head = cursp();
1795  codegen(s, tree->car, VAL);
1796  }
1797  tree = tree->cdr;
1798  while (tree) {
1799  n = tree->car->car;
1800  pos1 = pos2 = JMPLINK_START;
1801  while (n) {
1802  codegen(s, n->car, VAL);
1803  if (head) {
1804  gen_move(s, cursp(), head, 0);
1805  push(); push(); pop(); pop(); pop();
1806  if (nint(n->car->car) == NODE_SPLAT) {
1807  genop_3(s, OP_SEND, cursp(), new_sym(s, MRB_SYM_2(s->mrb, __case_eqq)), 1);
1808  }
1809  else {
1810  genop_3(s, OP_SEND, cursp(), new_sym(s, MRB_OPSYM_2(s->mrb, eqq)), 1);
1811  }
1812  }
1813  else {
1814  pop();
1815  }
1816  tmp = genjmp2(s, OP_JMPIF, cursp(), pos2, NOVAL);
1817  pos2 = tmp;
1818  n = n->cdr;
1819  }
1820  if (tree->car->car) {
1821  pos1 = genjmp_0(s, OP_JMP);
1822  dispatch_linked(s, pos2);
1823  }
1824  codegen(s, tree->car->cdr, val);
1825  if (val) pop();
1826  tmp = genjmp(s, OP_JMP, pos3);
1827  pos3 = tmp;
1828  dispatch(s, pos1);
1829  tree = tree->cdr;
1830  }
1831  if (val) {
1832  uint32_t pos = cursp();
1833  genop_1(s, OP_LOADNIL, cursp());
1834  if (pos3 != JMPLINK_START) dispatch_linked(s, pos3);
1835  if (head) pop();
1836  if (cursp() != pos) {
1837  gen_move(s, cursp(), pos, 0);
1838  }
1839  push();
1840  }
1841  else {
1842  if (pos3 != JMPLINK_START) {
1843  dispatch_linked(s, pos3);
1844  }
1845  if (head) {
1846  pop();
1847  }
1848  }
1849  }
1850  break;
1851 
1852  case NODE_SCOPE:
1853  scope_body(s, tree, NOVAL);
1854  break;
1855 
1856  case NODE_FCALL:
1857  case NODE_CALL:
1858  gen_call(s, tree, 0, 0, val, 0);
1859  break;
1860  case NODE_SCALL:
1861  gen_call(s, tree, 0, 0, val, 1);
1862  break;
1863 
1864  case NODE_DOT2:
1865  codegen(s, tree->car, val);
1866  codegen(s, tree->cdr, val);
1867  if (val) {
1868  pop(); pop();
1869  genop_1(s, OP_RANGE_INC, cursp());
1870  push();
1871  }
1872  break;
1873 
1874  case NODE_DOT3:
1875  codegen(s, tree->car, val);
1876  codegen(s, tree->cdr, val);
1877  if (val) {
1878  pop(); pop();
1879  genop_1(s, OP_RANGE_EXC, cursp());
1880  push();
1881  }
1882  break;
1883 
1884  case NODE_COLON2:
1885  {
1886  int sym = new_sym(s, nsym(tree->cdr));
1887 
1888  codegen(s, tree->car, VAL);
1889  pop();
1890  genop_2(s, OP_GETMCNST, cursp(), sym);
1891  if (val) push();
1892  }
1893  break;
1894 
1895  case NODE_COLON3:
1896  {
1897  int sym = new_sym(s, nsym(tree));
1898 
1899  genop_1(s, OP_OCLASS, cursp());
1900  genop_2(s, OP_GETMCNST, cursp(), sym);
1901  if (val) push();
1902  }
1903  break;
1904 
1905  case NODE_ARRAY:
1906  {
1907  int n;
1908 
1909  n = gen_values(s, tree, val, 0);
1910  if (n >= 0) {
1911  if (val) {
1912  pop_n(n);
1913  genop_2(s, OP_ARRAY, cursp(), n);
1914  push();
1915  }
1916  }
1917  else if (val) {
1918  push();
1919  }
1920  }
1921  break;
1922 
1923  case NODE_HASH:
1924  case NODE_KW_HASH:
1925  {
1926  int len = 0;
1927  mrb_bool update = FALSE;
1928 
1929  while (tree) {
1930  if (nint(tree->car->car->car) == NODE_KW_REST_ARGS) {
1931  if (len > 0) {
1932  pop_n(len*2);
1933  if (!update) {
1934  genop_2(s, OP_HASH, cursp(), len);
1935  }
1936  else {
1937  pop();
1938  genop_2(s, OP_HASHADD, cursp(), len);
1939  }
1940  push();
1941  }
1942  codegen(s, tree->car->cdr, VAL);
1943  if (len > 0 || update) {
1944  pop(); pop();
1945  genop_1(s, OP_HASHCAT, cursp());
1946  push();
1947  }
1948  update = TRUE;
1949  len = 0;
1950  }
1951  else {
1952  codegen(s, tree->car->car, val);
1953  codegen(s, tree->car->cdr, val);
1954  len++;
1955  }
1956  tree = tree->cdr;
1957  if (val && cursp() > 127) {
1958  pop_n(len*2);
1959  if (!update) {
1960  genop_2(s, OP_HASH, cursp(), len);
1961  }
1962  else {
1963  pop();
1964  genop_2(s, OP_HASHADD, cursp(), len);
1965  }
1966  push();
1967  update = TRUE;
1968  len = 0;
1969  }
1970  }
1971  if (val) {
1972  pop_n(len*2);
1973  if (!update) {
1974  genop_2(s, OP_HASH, cursp(), len);
1975  }
1976  else {
1977  pop();
1978  if (len > 0) {
1979  genop_2(s, OP_HASHADD, cursp(), len);
1980  }
1981  }
1982  push();
1983  }
1984  }
1985  break;
1986 
1987  case NODE_SPLAT:
1988  codegen(s, tree, val);
1989  break;
1990 
1991  case NODE_ASGN:
1992  codegen(s, tree->cdr, VAL);
1993  pop();
1994  gen_assignment(s, tree->car, cursp(), val);
1995  break;
1996 
1997  case NODE_MASGN:
1998  {
1999  int len = 0, n = 0, post = 0;
2000  node *t = tree->cdr, *p;
2001  int rhs = cursp();
2002 
2003  if (nint(t->car) == NODE_ARRAY && t->cdr && nosplat(t->cdr)) {
2004  /* fixed rhs */
2005  t = t->cdr;
2006  while (t) {
2007  codegen(s, t->car, VAL);
2008  len++;
2009  t = t->cdr;
2010  }
2011  tree = tree->car;
2012  if (tree->car) { /* pre */
2013  t = tree->car;
2014  n = 0;
2015  while (t) {
2016  if (n < len) {
2017  gen_assignment(s, t->car, rhs+n, NOVAL);
2018  n++;
2019  }
2020  else {
2021  genop_1(s, OP_LOADNIL, rhs+n);
2022  gen_assignment(s, t->car, rhs+n, NOVAL);
2023  }
2024  t = t->cdr;
2025  }
2026  }
2027  t = tree->cdr;
2028  if (t) {
2029  if (t->cdr) { /* post count */
2030  p = t->cdr->car;
2031  while (p) {
2032  post++;
2033  p = p->cdr;
2034  }
2035  }
2036  if (t->car) { /* rest (len - pre - post) */
2037  int rn;
2038 
2039  if (len < post + n) {
2040  rn = 0;
2041  }
2042  else {
2043  rn = len - post - n;
2044  }
2045  genop_3(s, OP_ARRAY2, cursp(), rhs+n, rn);
2046  gen_assignment(s, t->car, cursp(), NOVAL);
2047  n += rn;
2048  }
2049  if (t->cdr && t->cdr->car) {
2050  t = t->cdr->car;
2051  while (n<len) {
2052  gen_assignment(s, t->car, rhs+n, NOVAL);
2053  t = t->cdr;
2054  n++;
2055  }
2056  }
2057  }
2058  pop_n(len);
2059  if (val) {
2060  genop_2(s, OP_ARRAY, rhs, len);
2061  push();
2062  }
2063  }
2064  else {
2065  /* variable rhs */
2066  codegen(s, t, VAL);
2067  gen_vmassignment(s, tree->car, rhs, val);
2068  if (!val) {
2069  pop();
2070  }
2071  }
2072  }
2073  break;
2074 
2075  case NODE_OP_ASGN:
2076  {
2077  mrb_sym sym = nsym(tree->cdr->car);
2078  mrb_int len;
2079  const char *name = mrb_sym_name_len(s->mrb, sym, &len);
2080  int idx, callargs = -1, vsp = -1;
2081 
2082  if ((len == 2 && name[0] == '|' && name[1] == '|') &&
2083  (nint(tree->car->car) == NODE_CONST ||
2084  nint(tree->car->car) == NODE_CVAR)) {
2085  int catch_entry, begin, end;
2086  int noexc, exc;
2087  struct loopinfo *lp;
2088 
2089  lp = loop_push(s, LOOP_BEGIN);
2090  lp->pc0 = new_label(s);
2091  catch_entry = catch_handler_new(s);
2092  begin = s->pc;
2093  exc = cursp();
2094  codegen(s, tree->car, VAL);
2095  end = s->pc;
2096  noexc = genjmp_0(s, OP_JMP);
2097  lp->type = LOOP_RESCUE;
2098  catch_handler_set(s, catch_entry, MRB_CATCH_RESCUE, begin, end, s->pc);
2099  genop_1(s, OP_EXCEPT, exc);
2100  genop_1(s, OP_LOADF, exc);
2101  dispatch(s, noexc);
2102  loop_pop(s, NOVAL);
2103  }
2104  else if (nint(tree->car->car) == NODE_CALL) {
2105  node *n = tree->car->cdr;
2106  int base, i, nargs = 0;
2107  callargs = 0;
2108 
2109  if (val) {
2110  vsp = cursp();
2111  push();
2112  }
2113  codegen(s, n->car, VAL); /* receiver */
2114  idx = new_sym(s, nsym(n->cdr->car));
2115  base = cursp()-1;
2116  if (n->cdr->cdr->car) {
2117  nargs = gen_values(s, n->cdr->cdr->car->car, VAL, 1);
2118  if (nargs >= 0) {
2119  callargs = nargs;
2120  }
2121  else { /* varargs */
2122  push();
2123  nargs = 1;
2124  callargs = CALL_MAXARGS;
2125  }
2126  }
2127  /* copy receiver and arguments */
2128  gen_move(s, cursp(), base, 1);
2129  for (i=0; i<nargs; i++) {
2130  gen_move(s, cursp()+i+1, base+i+1, 1);
2131  }
2132  push_n(nargs+2);pop_n(nargs+2); /* space for receiver, arguments and a block */
2133  genop_3(s, OP_SEND, cursp(), idx, callargs);
2134  push();
2135  }
2136  else {
2137  codegen(s, tree->car, VAL);
2138  }
2139  if (len == 2 &&
2140  ((name[0] == '|' && name[1] == '|') ||
2141  (name[0] == '&' && name[1] == '&'))) {
2142  int pos;
2143 
2144  pop();
2145  if (val) {
2146  if (vsp >= 0) {
2147  gen_move(s, vsp, cursp(), 1);
2148  }
2149  pos = genjmp2_0(s, name[0]=='|'?OP_JMPIF:OP_JMPNOT, cursp(), val);
2150  }
2151  else {
2152  pos = genjmp2_0(s, name[0]=='|'?OP_JMPIF:OP_JMPNOT, cursp(), val);
2153  }
2154  codegen(s, tree->cdr->cdr->car, VAL);
2155  pop();
2156  if (val && vsp >= 0) {
2157  gen_move(s, vsp, cursp(), 1);
2158  }
2159  if (nint(tree->car->car) == NODE_CALL) {
2160  if (callargs == CALL_MAXARGS) {
2161  pop();
2162  genop_1(s, OP_ARYPUSH, cursp());
2163  }
2164  else {
2165  pop_n(callargs);
2166  callargs++;
2167  }
2168  pop();
2169  idx = new_sym(s, attrsym(s, nsym(tree->car->cdr->cdr->car)));
2170  genop_3(s, OP_SEND, cursp(), idx, callargs);
2171  }
2172  else {
2173  gen_assignment(s, tree->car, cursp(), val);
2174  }
2175  dispatch(s, pos);
2176  goto exit;
2177  }
2178  codegen(s, tree->cdr->cdr->car, VAL);
2179  push(); pop();
2180  pop(); pop();
2181 
2182  if (len == 1 && name[0] == '+') {
2183  gen_addsub(s, OP_ADD, cursp());
2184  }
2185  else if (len == 1 && name[0] == '-') {
2186  gen_addsub(s, OP_SUB, cursp());
2187  }
2188  else if (len == 1 && name[0] == '*') {
2189  genop_1(s, OP_MUL, cursp());
2190  }
2191  else if (len == 1 && name[0] == '/') {
2192  genop_1(s, OP_DIV, cursp());
2193  }
2194  else if (len == 1 && name[0] == '<') {
2195  genop_1(s, OP_LT, cursp());
2196  }
2197  else if (len == 2 && name[0] == '<' && name[1] == '=') {
2198  genop_1(s, OP_LE, cursp());
2199  }
2200  else if (len == 1 && name[0] == '>') {
2201  genop_1(s, OP_GT, cursp());
2202  }
2203  else if (len == 2 && name[0] == '>' && name[1] == '=') {
2204  genop_1(s, OP_GE, cursp());
2205  }
2206  else {
2207  idx = new_sym(s, sym);
2208  genop_3(s, OP_SEND, cursp(), idx, 1);
2209  }
2210  if (callargs < 0) {
2211  gen_assignment(s, tree->car, cursp(), val);
2212  }
2213  else {
2214  if (val && vsp >= 0) {
2215  gen_move(s, vsp, cursp(), 0);
2216  }
2217  if (callargs == CALL_MAXARGS) {
2218  pop();
2219  genop_1(s, OP_ARYPUSH, cursp());
2220  }
2221  else {
2222  pop_n(callargs);
2223  callargs++;
2224  }
2225  pop();
2226  idx = new_sym(s, attrsym(s,nsym(tree->car->cdr->cdr->car)));
2227  genop_3(s, OP_SEND, cursp(), idx, callargs);
2228  }
2229  }
2230  break;
2231 
2232  case NODE_SUPER:
2233  {
2234  codegen_scope *s2 = s;
2235  int lv = 0;
2236  int n = 0, noop = 0, sendv = 0;
2237 
2238  push(); /* room for receiver */
2239  while (!s2->mscope) {
2240  lv++;
2241  s2 = s2->prev;
2242  if (!s2) break;
2243  }
2244  genop_2S(s, OP_ARGARY, cursp(), (lv & 0xf));
2245  push(); push(); /* ARGARY pushes two values */
2246  pop(); pop();
2247  if (tree) {
2248  node *args = tree->car;
2249  if (args) {
2250  n = gen_values(s, args, VAL, 0);
2251  if (n < 0) {
2252  n = noop = sendv = 1;
2253  push();
2254  }
2255  }
2256  }
2257  if (tree && tree->cdr) {
2258  codegen(s, tree->cdr, VAL);
2259  pop();
2260  }
2261  else {
2262  genop_1(s, OP_LOADNIL, cursp());
2263  push(); pop();
2264  }
2265  pop_n(n+1);
2266  if (sendv) n = CALL_MAXARGS;
2267  genop_2(s, OP_SUPER, cursp(), n);
2268  if (val) push();
2269  }
2270  break;
2271 
2272  case NODE_ZSUPER:
2273  {
2274  codegen_scope *s2 = s;
2275  int lv = 0, ainfo = 0;
2276 
2277  push(); /* room for receiver */
2278  while (!s2->mscope) {
2279  lv++;
2280  s2 = s2->prev;
2281  if (!s2) break;
2282  }
2283  if (s2) ainfo = s2->ainfo;
2284  genop_2S(s, OP_ARGARY, cursp(), (ainfo<<4)|(lv & 0xf));
2285  push(); push(); pop(); /* ARGARY pushes two values */
2286  if (tree && tree->cdr) {
2287  codegen(s, tree->cdr, VAL);
2288  pop();
2289  }
2290  pop(); pop();
2291  genop_2(s, OP_SUPER, cursp(), CALL_MAXARGS);
2292  if (val) push();
2293  }
2294  break;
2295 
2296  case NODE_RETURN:
2297  if (tree) {
2298  gen_retval(s, tree);
2299  }
2300  else {
2301  genop_1(s, OP_LOADNIL, cursp());
2302  }
2303  if (s->loop) {
2304  gen_return(s, OP_RETURN_BLK, cursp());
2305  }
2306  else {
2307  gen_return(s, OP_RETURN, cursp());
2308  }
2309  if (val) push();
2310  break;
2311 
2312  case NODE_YIELD:
2313  {
2314  codegen_scope *s2 = s;
2315  int lv = 0, ainfo = 0;
2316  int n = 0, sendv = 0;
2317 
2318  while (!s2->mscope) {
2319  lv++;
2320  s2 = s2->prev;
2321  if (!s2) break;
2322  }
2323  if (s2) ainfo = s2->ainfo;
2324  push();
2325  if (tree) {
2326  n = gen_values(s, tree, VAL, 0);
2327  if (n < 0) {
2328  n = sendv = 1;
2329  push();
2330  }
2331  }
2332  push();pop(); /* space for a block */
2333  pop_n(n+1);
2334  genop_2S(s, OP_BLKPUSH, cursp(), (ainfo<<4)|(lv & 0xf));
2335  if (sendv) n = CALL_MAXARGS;
2336  genop_3(s, OP_SEND, cursp(), new_sym(s, MRB_SYM_2(s->mrb, call)), n);
2337  if (val) push();
2338  }
2339  break;
2340 
2341  case NODE_BREAK:
2342  loop_break(s, tree);
2343  if (val) push();
2344  break;
2345 
2346  case NODE_NEXT:
2347  if (!s->loop) {
2348  raise_error(s, "unexpected next");
2349  }
2350  else if (s->loop->type == LOOP_NORMAL) {
2351  codegen(s, tree, NOVAL);
2352  genjmp(s, OP_JMPUW, s->loop->pc0);
2353  }
2354  else {
2355  if (tree) {
2356  codegen(s, tree, VAL);
2357  pop();
2358  }
2359  else {
2360  genop_1(s, OP_LOADNIL, cursp());
2361  }
2362  gen_return(s, OP_RETURN, cursp());
2363  }
2364  if (val) push();
2365  break;
2366 
2367  case NODE_REDO:
2368  if (!s->loop || s->loop->type == LOOP_BEGIN || s->loop->type == LOOP_RESCUE) {
2369  raise_error(s, "unexpected redo");
2370  }
2371  else {
2372  genjmp(s, OP_JMPUW, s->loop->pc2);
2373  }
2374  if (val) push();
2375  break;
2376 
2377  case NODE_RETRY:
2378  {
2379  const char *msg = "unexpected retry";
2380  const struct loopinfo *lp = s->loop;
2381 
2382  while (lp && lp->type != LOOP_RESCUE) {
2383  lp = lp->prev;
2384  }
2385  if (!lp) {
2386  raise_error(s, msg);
2387  }
2388  else {
2389  genjmp(s, OP_JMPUW, lp->pc0);
2390  }
2391  if (val) push();
2392  }
2393  break;
2394 
2395  case NODE_LVAR:
2396  if (val) {
2397  int idx = lv_idx(s, nsym(tree));
2398 
2399  if (idx > 0) {
2400  gen_move(s, cursp(), idx, val);
2401  }
2402  else {
2403  int lv = search_upvar(s, nsym(tree), &idx);
2404  genop_3(s, OP_GETUPVAR, cursp(), idx, lv);
2405  }
2406  push();
2407  }
2408  break;
2409 
2410  case NODE_NVAR:
2411  if (val) {
2412  int idx = nint(tree);
2413 
2414  gen_move(s, cursp(), idx, val);
2415 
2416  push();
2417  }
2418  break;
2419 
2420  case NODE_GVAR:
2421  {
2422  int sym = new_sym(s, nsym(tree));
2423 
2424  genop_2(s, OP_GETGV, cursp(), sym);
2425  if (val) push();
2426  }
2427  break;
2428 
2429  case NODE_IVAR:
2430  {
2431  int sym = new_sym(s, nsym(tree));
2432 
2433  genop_2(s, OP_GETIV, cursp(), sym);
2434  if (val) push();
2435  }
2436  break;
2437 
2438  case NODE_CVAR:
2439  {
2440  int sym = new_sym(s, nsym(tree));
2441 
2442  genop_2(s, OP_GETCV, cursp(), sym);
2443  if (val) push();
2444  }
2445  break;
2446 
2447  case NODE_CONST:
2448  {
2449  int sym = new_sym(s, nsym(tree));
2450 
2451  genop_2(s, OP_GETCONST, cursp(), sym);
2452  if (val) push();
2453  }
2454  break;
2455 
2456  case NODE_BACK_REF:
2457  if (val) {
2458  char buf[] = {'$', nchar(tree)};
2459  int sym = new_sym(s, mrb_intern(s->mrb, buf, sizeof(buf)));
2460 
2461  genop_2(s, OP_GETGV, cursp(), sym);
2462  push();
2463  }
2464  break;
2465 
2466  case NODE_NTH_REF:
2467  if (val) {
2468  mrb_state *mrb = s->mrb;
2469  mrb_value str;
2470  int sym;
2471 
2472  str = mrb_format(mrb, "$%d", nint(tree));
2473  sym = new_sym(s, mrb_intern_str(mrb, str));
2474  genop_2(s, OP_GETGV, cursp(), sym);
2475  push();
2476  }
2477  break;
2478 
2479  case NODE_ARG:
2480  /* should not happen */
2481  break;
2482 
2483  case NODE_BLOCK_ARG:
2484  codegen(s, tree, val);
2485  break;
2486 
2487  case NODE_INT:
2488  if (val) {
2489  char *p = (char*)tree->car;
2490  int base = nint(tree->cdr->car);
2491  mrb_int i;
2493 
2495  if (overflow) {
2496  codegen_error(s, "integer overflow");
2497  }
2498  else {
2499  if (i < 0) {
2500  if (i == -1) genop_1(s, OP_LOADI__1, cursp());
2501  else if (i >= -0xff) genop_2(s, OP_LOADINEG, cursp(), (uint16_t)-i);
2502  else if (i >= INT16_MIN) genop_2S(s, OP_LOADI16, cursp(), (uint16_t)i);
2503  else if (i >= INT32_MIN) genop_2SS(s, OP_LOADI32, cursp(), (uint32_t)i);
2504  else goto lit_int;
2505  }
2506  else if (i < 8) genop_1(s, OP_LOADI_0 + (uint8_t)i, cursp());
2507  else if (i <= 0xff) genop_2(s, OP_LOADI, cursp(), (uint16_t)i);
2508  else if (i <= INT16_MAX) genop_2S(s, OP_LOADI16, cursp(), (uint16_t)i);
2509  else if (i <= INT32_MAX) genop_2SS(s, OP_LOADI32, cursp(), (uint32_t)i);
2510  else {
2511  int off;
2512 
2513  lit_int:
2514  off = new_lit(s, mrb_int_value(s->mrb, i));
2515  genop_bs(s, OP_LOADL, cursp(), off);
2516  }
2517  }
2518  push();
2519  }
2520  break;
2521 
2522 #ifndef MRB_NO_FLOAT
2523  case NODE_FLOAT:
2524  if (val) {
2525  char *p = (char*)tree;
2527  int off = new_lit(s, mrb_float_value(s->mrb, f));
2528 
2529  genop_bs(s, OP_LOADL, cursp(), off);
2530  push();
2531  }
2532  break;
2533 #endif
2534 
2535  case NODE_NEGATE:
2536  {
2537  nt = nint(tree->car);
2538  switch (nt) {
2539 #ifndef MRB_NO_FLOAT
2540  case NODE_FLOAT:
2541  if (val) {
2542  char *p = (char*)tree->cdr;
2544  int off = new_lit(s, mrb_float_value(s->mrb, -f));
2545 
2546  genop_bs(s, OP_LOADL, cursp(), off);
2547  push();
2548  }
2549  break;
2550 #endif
2551 
2552  case NODE_INT:
2553  if (val) {
2554  char *p = (char*)tree->cdr->car;
2555  int base = nint(tree->cdr->cdr->car);
2556  mrb_int i;
2558 
2559  i = readint_mrb_int(s, p, base, TRUE, &overflow);
2560  if (overflow) {
2561  codegen_error(s, "integer overflow");
2562  }
2563  else {
2564  if (i == -1) genop_1(s, OP_LOADI__1, cursp());
2565  else if (i >= -0xff) {
2566  genop_2(s, OP_LOADINEG, cursp(), (uint16_t)-i);
2567  }
2568  else if (i >= INT16_MIN) {
2569  genop_2S(s, OP_LOADI16, cursp(), (uint16_t)i);
2570  }
2571  else if (i >= INT32_MIN) {
2572  genop_2SS(s, OP_LOADI32, cursp(), (uint32_t)i);
2573  }
2574  else {
2575  int off = new_lit(s, mrb_int_value(s->mrb, i));
2576  genop_bs(s, OP_LOADL, cursp(), off);
2577  }
2578  }
2579  push();
2580  }
2581  break;
2582 
2583  default:
2584  if (val) {
2585  int sym = new_sym(s, MRB_OPSYM_2(s->mrb, minus));
2586  codegen(s, tree, VAL);
2587  pop();
2588  genop_3(s, OP_SEND, cursp(), sym, 0);
2589  push();
2590  }
2591  else {
2592  codegen(s, tree, NOVAL);
2593  }
2594  break;
2595  }
2596  }
2597  break;
2598 
2599  case NODE_STR:
2600  if (val) {
2601  char *p = (char*)tree->car;
2602  size_t len = (intptr_t)tree->cdr;
2603  int ai = mrb_gc_arena_save(s->mrb);
2604  int off = new_lit(s, mrb_str_new(s->mrb, p, len));
2605 
2606  mrb_gc_arena_restore(s->mrb, ai);
2607  genop_bs(s, OP_STRING, cursp(), off);
2608  push();
2609  }
2610  break;
2611 
2612  case NODE_HEREDOC:
2613  tree = ((struct mrb_parser_heredoc_info *)tree)->doc;
2614  /* fall through */
2615  case NODE_DSTR:
2616  if (val) {
2617  node *n = tree;
2618 
2619  if (!n) {
2620  genop_1(s, OP_LOADNIL, cursp());
2621  push();
2622  break;
2623  }
2624  codegen(s, n->car, VAL);
2625  n = n->cdr;
2626  while (n) {
2627  codegen(s, n->car, VAL);
2628  pop(); pop();
2629  genop_1(s, OP_STRCAT, cursp());
2630  push();
2631  n = n->cdr;
2632  }
2633  }
2634  else {
2635  node *n = tree;
2636 
2637  while (n) {
2638  if (nint(n->car->car) != NODE_STR) {
2639  codegen(s, n->car, NOVAL);
2640  }
2641  n = n->cdr;
2642  }
2643  }
2644  break;
2645 
2646  case NODE_WORDS:
2647  gen_literal_array(s, tree, FALSE, val);
2648  break;
2649 
2650  case NODE_SYMBOLS:
2651  gen_literal_array(s, tree, TRUE, val);
2652  break;
2653 
2654  case NODE_DXSTR:
2655  {
2656  node *n;
2657  int ai = mrb_gc_arena_save(s->mrb);
2658  int sym = new_sym(s, MRB_SYM_2(s->mrb, Kernel));
2659 
2660  genop_1(s, OP_LOADSELF, cursp());
2661  push();
2662  codegen(s, tree->car, VAL);
2663  n = tree->cdr;
2664  while (n) {
2665  if (nint(n->car->car) == NODE_XSTR) {
2666  n->car->car = (struct mrb_ast_node*)(intptr_t)NODE_STR;
2667  mrb_assert(!n->cdr); /* must be the end */
2668  }
2669  codegen(s, n->car, VAL);
2670  pop(); pop();
2671  genop_1(s, OP_STRCAT, cursp());
2672  push();
2673  n = n->cdr;
2674  }
2675  push(); /* for block */
2676  pop_n(3);
2677  sym = new_sym(s, MRB_OPSYM_2(s->mrb, tick)); /* ` */
2678  genop_3(s, OP_SEND, cursp(), sym, 1);
2679  if (val) push();
2680  mrb_gc_arena_restore(s->mrb, ai);
2681  }
2682  break;
2683 
2684  case NODE_XSTR:
2685  {
2686  char *p = (char*)tree->car;
2687  size_t len = (intptr_t)tree->cdr;
2688  int ai = mrb_gc_arena_save(s->mrb);
2689  int off = new_lit(s, mrb_str_new(s->mrb, p, len));
2690  int sym;
2691 
2692  genop_1(s, OP_LOADSELF, cursp());
2693  push();
2694  genop_bs(s, OP_STRING, cursp(), off);
2695  push(); push();
2696  pop_n(3);
2697  sym = new_sym(s, MRB_OPSYM_2(s->mrb, tick)); /* ` */
2698  genop_3(s, OP_SEND, cursp(), sym, 1);
2699  if (val) push();
2700  mrb_gc_arena_restore(s->mrb, ai);
2701  }
2702  break;
2703 
2704  case NODE_REGX:
2705  if (val) {
2706  char *p1 = (char*)tree->car;
2707  char *p2 = (char*)tree->cdr->car;
2708  char *p3 = (char*)tree->cdr->cdr;
2709  int ai = mrb_gc_arena_save(s->mrb);
2710  int sym = new_sym(s, mrb_intern_lit(s->mrb, REGEXP_CLASS));
2711  int off = new_lit(s, mrb_str_new_cstr(s->mrb, p1));
2712  int argc = 1;
2713 
2714  genop_1(s, OP_OCLASS, cursp());
2715  genop_2(s, OP_GETMCNST, cursp(), sym);
2716  push();
2717  genop_bs(s, OP_STRING, cursp(), off);
2718  push();
2719  if (p2 || p3) {
2720  if (p2) { /* opt */
2721  off = new_lit(s, mrb_str_new_cstr(s->mrb, p2));
2722  genop_bs(s, OP_STRING, cursp(), off);
2723  }
2724  else {
2725  genop_1(s, OP_LOADNIL, cursp());
2726  }
2727  push();
2728  argc++;
2729  if (p3) { /* enc */
2730  off = new_lit(s, mrb_str_new(s->mrb, p3, 1));
2731  genop_bs(s, OP_STRING, cursp(), off);
2732  push();
2733  argc++;
2734  }
2735  }
2736  push(); /* space for a block */
2737  pop_n(argc+2);
2738  sym = new_sym(s, MRB_SYM_2(s->mrb, compile));
2739  genop_3(s, OP_SEND, cursp(), sym, argc);
2740  mrb_gc_arena_restore(s->mrb, ai);
2741  push();
2742  }
2743  break;
2744 
2745  case NODE_DREGX:
2746  if (val) {
2747  node *n = tree->car;
2748  int ai = mrb_gc_arena_save(s->mrb);
2749  int sym = new_sym(s, mrb_intern_lit(s->mrb, REGEXP_CLASS));
2750  int argc = 1;
2751  int off;
2752  char *p;
2753 
2754  genop_1(s, OP_OCLASS, cursp());
2755  genop_2(s, OP_GETMCNST, cursp(), sym);
2756  push();
2757  codegen(s, n->car, VAL);
2758  n = n->cdr;
2759  while (n) {
2760  codegen(s, n->car, VAL);
2761  pop(); pop();
2762  genop_1(s, OP_STRCAT, cursp());
2763  push();
2764  n = n->cdr;
2765  }
2766  n = tree->cdr->cdr;
2767  if (n->car) { /* tail */
2768  p = (char*)n->car;
2769  off = new_lit(s, mrb_str_new_cstr(s->mrb, p));
2770  codegen(s, tree->car, VAL);
2771  genop_bs(s, OP_STRING, cursp(), off);
2772  pop();
2773  genop_1(s, OP_STRCAT, cursp());
2774  push();
2775  }
2776  if (n->cdr->car) { /* opt */
2777  char *p2 = (char*)n->cdr->car;
2778  off = new_lit(s, mrb_str_new_cstr(s->mrb, p2));
2779  genop_bs(s, OP_STRING, cursp(), off);
2780  push();
2781  argc++;
2782  }
2783  if (n->cdr->cdr) { /* enc */
2784  char *p2 = (char*)n->cdr->cdr;
2785  off = new_lit(s, mrb_str_new_cstr(s->mrb, p2));
2786  genop_bs(s, OP_STRING, cursp(), off);
2787  push();
2788  argc++;
2789  }
2790  push(); /* space for a block */
2791  pop_n(argc+2);
2792  sym = new_sym(s, MRB_SYM_2(s->mrb, compile));
2793  genop_3(s, OP_SEND, cursp(), sym, argc);
2794  mrb_gc_arena_restore(s->mrb, ai);
2795  push();
2796  }
2797  else {
2798  node *n = tree->car;
2799 
2800  while (n) {
2801  if (nint(n->car->car) != NODE_STR) {
2802  codegen(s, n->car, NOVAL);
2803  }
2804  n = n->cdr;
2805  }
2806  }
2807  break;
2808 
2809  case NODE_SYM:
2810  if (val) {
2811  int sym = new_sym(s, nsym(tree));
2812 
2813  genop_bs(s, OP_LOADSYM, cursp(), sym);
2814  push();
2815  }
2816  break;
2817 
2818  case NODE_DSYM:
2819  codegen(s, tree, val);
2820  if (val) {
2821  gen_intern(s);
2822  }
2823  break;
2824 
2825  case NODE_SELF:
2826  if (val) {
2827  genop_1(s, OP_LOADSELF, cursp());
2828  push();
2829  }
2830  break;
2831 
2832  case NODE_NIL:
2833  if (val) {
2834  genop_1(s, OP_LOADNIL, cursp());
2835  push();
2836  }
2837  break;
2838 
2839  case NODE_TRUE:
2840  if (val) {
2841  genop_1(s, OP_LOADT, cursp());
2842  push();
2843  }
2844  break;
2845 
2846  case NODE_FALSE:
2847  if (val) {
2848  genop_1(s, OP_LOADF, cursp());
2849  push();
2850  }
2851  break;
2852 
2853  case NODE_ALIAS:
2854  {
2855  int a = new_sym(s, nsym(tree->car));
2856  int b = new_sym(s, nsym(tree->cdr));
2857 
2858  genop_2(s, OP_ALIAS, a, b);
2859  if (val) {
2860  genop_1(s, OP_LOADNIL, cursp());
2861  push();
2862  }
2863  }
2864  break;
2865 
2866  case NODE_UNDEF:
2867  {
2868  node *t = tree;
2869 
2870  while (t) {
2871  int symbol = new_sym(s, nsym(t->car));
2872  genop_1(s, OP_UNDEF, symbol);
2873  t = t->cdr;
2874  }
2875  if (val) {
2876  genop_1(s, OP_LOADNIL, cursp());
2877  push();
2878  }
2879  }
2880  break;
2881 
2882  case NODE_CLASS:
2883  {
2884  int idx;
2885  node *body;
2886 
2887  if (tree->car->car == (node*)0) {
2888  genop_1(s, OP_LOADNIL, cursp());
2889  push();
2890  }
2891  else if (tree->car->car == (node*)1) {
2892  genop_1(s, OP_OCLASS, cursp());
2893  push();
2894  }
2895  else {
2896  codegen(s, tree->car->car, VAL);
2897  }
2898  if (tree->cdr->car) {
2899  codegen(s, tree->cdr->car, VAL);
2900  }
2901  else {
2902  genop_1(s, OP_LOADNIL, cursp());
2903  push();
2904  }
2905  pop(); pop();
2906  idx = new_sym(s, nsym(tree->car->cdr));
2907  genop_2(s, OP_CLASS, cursp(), idx);
2908  body = tree->cdr->cdr->car;
2909  if (nint(body->cdr->car) == NODE_BEGIN && body->cdr->cdr == NULL) {
2910  genop_1(s, OP_LOADNIL, cursp());
2911  }
2912  else {
2913  idx = scope_body(s, body, val);
2914  genop_bs(s, OP_EXEC, cursp(), idx);
2915  }
2916  if (val) {
2917  push();
2918  }
2919  }
2920  break;
2921 
2922  case NODE_MODULE:
2923  {
2924  int idx;
2925 
2926  if (tree->car->car == (node*)0) {
2927  genop_1(s, OP_LOADNIL, cursp());
2928  push();
2929  }
2930  else if (tree->car->car == (node*)1) {
2931  genop_1(s, OP_OCLASS, cursp());
2932  push();
2933  }
2934  else {
2935  codegen(s, tree->car->car, VAL);
2936  }
2937  pop();
2938  idx = new_sym(s, nsym(tree->car->cdr));
2939  genop_2(s, OP_MODULE, cursp(), idx);
2940  if (nint(tree->cdr->car->cdr->car) == NODE_BEGIN &&
2941  tree->cdr->car->cdr->cdr == NULL) {
2942  genop_1(s, OP_LOADNIL, cursp());
2943  }
2944  else {
2945  idx = scope_body(s, tree->cdr->car, val);
2946  genop_bs(s, OP_EXEC, cursp(), idx);
2947  }
2948  if (val) {
2949  push();
2950  }
2951  }
2952  break;
2953 
2954  case NODE_SCLASS:
2955  {
2956  int idx;
2957 
2958  codegen(s, tree->car, VAL);
2959  pop();
2960  genop_1(s, OP_SCLASS, cursp());
2961  if (nint(tree->cdr->car->cdr->car) == NODE_BEGIN &&
2962  tree->cdr->car->cdr->cdr == NULL) {
2963  genop_1(s, OP_LOADNIL, cursp());
2964  }
2965  else {
2966  idx = scope_body(s, tree->cdr->car, val);
2967  genop_bs(s, OP_EXEC, cursp(), idx);
2968  }
2969  if (val) {
2970  push();
2971  }
2972  }
2973  break;
2974 
2975  case NODE_DEF:
2976  {
2977  int sym = new_sym(s, nsym(tree->car));
2978  int idx = lambda_body(s, tree->cdr, 0);
2979 
2980  genop_1(s, OP_TCLASS, cursp());
2981  push();
2982  genop_bs(s, OP_METHOD, cursp(), idx);
2983  push(); pop();
2984  pop();
2985  genop_2(s, OP_DEF, cursp(), sym);
2986  if (val) {
2987  genop_bs(s, OP_LOADSYM, cursp(), sym);
2988  push();
2989  }
2990  }
2991  break;
2992 
2993  case NODE_SDEF:
2994  {
2995  node *recv = tree->car;
2996  int sym = new_sym(s, nsym(tree->cdr->car));
2997  int idx = lambda_body(s, tree->cdr->cdr, 0);
2998 
2999  codegen(s, recv, VAL);
3000  pop();
3001  genop_1(s, OP_SCLASS, cursp());
3002  push();
3003  genop_bs(s, OP_METHOD, cursp(), idx);
3004  pop();
3005  genop_2(s, OP_DEF, cursp(), sym);
3006  if (val) {
3007  genop_bs(s, OP_LOADSYM, cursp(), sym);
3008  push();
3009  }
3010  }
3011  break;
3012 
3013  case NODE_POSTEXE:
3014  codegen(s, tree, NOVAL);
3015  break;
3016 
3017  default:
3018  break;
3019  }
3020  exit:
3021  s->rlev = rlev;
3022 }
3023 
3024 static void
3026 {
3027  mrb_irep *irep;
3028  codegen_scope *prev = s->prev;
3029 
3030  if (prev->irep == NULL) {
3031  irep = mrb_add_irep(s->mrb);
3032  prev->irep = s->irep = irep;
3033  return;
3034  }
3035  else {
3036  if (prev->irep->rlen == UINT16_MAX) {
3037  codegen_error(s, "too many nested blocks/methods");
3038  }
3039  s->irep = irep = mrb_add_irep(s->mrb);
3040  if (prev->irep->rlen == prev->rcapa) {
3041  prev->rcapa *= 2;
3042  prev->reps = (mrb_irep**)codegen_realloc(s, prev->reps, sizeof(mrb_irep*)*prev->rcapa);
3043  }
3044  prev->reps[prev->irep->rlen] = irep;
3045  prev->irep->rlen++;
3046  }
3047 }
3048 
3049 static codegen_scope*
3051 {
3052  static const codegen_scope codegen_scope_zero = { 0 };
3053  mrb_pool *pool = mrb_pool_open(mrb);
3055 
3056  if (!s) {
3057  if (prev)
3058  codegen_error(prev, "unexpected scope");
3059  return NULL;
3060  }
3061  *s = codegen_scope_zero;
3062  s->mrb = mrb;
3063  s->mpool = pool;
3064  if (!prev) return s;
3065  s->prev = prev;
3066  s->ainfo = -1;
3067  s->mscope = 0;
3068 
3069  scope_add_irep(s);
3070 
3071  s->rcapa = 8;
3072  s->reps = (mrb_irep**)mrb_malloc(mrb, sizeof(mrb_irep*)*s->rcapa);
3073 
3074  s->icapa = 1024;
3075  s->iseq = (mrb_code*)mrb_malloc(mrb, sizeof(mrb_code)*s->icapa);
3076 
3077  s->pcapa = 32;
3078  s->pool = (mrb_pool_value*)mrb_malloc(mrb, sizeof(mrb_pool_value)*s->pcapa);
3079 
3080  s->scapa = 256;
3081  s->syms = (mrb_sym*)mrb_malloc(mrb, sizeof(mrb_sym)*s->scapa);
3082 
3083  s->lv = nlv;
3084  s->sp += node_len(nlv)+1; /* add self */
3085  s->nlocals = s->sp;
3086  if (nlv) {
3087  mrb_sym *lv;
3088  node *n = nlv;
3089  size_t i = 0;
3090 
3091  s->irep->lv = lv = (mrb_sym*)mrb_malloc(mrb, sizeof(mrb_sym)*(s->nlocals-1));
3092  for (i=0, n=nlv; n; i++,n=n->cdr) {
3093  lv[i] = lv_name(n);
3094  }
3095  mrb_assert(i + 1 == s->nlocals);
3096  }
3097  s->ai = mrb_gc_arena_save(mrb);
3098 
3099  s->filename_sym = prev->filename_sym;
3100  if (s->filename_sym) {
3101  s->lines = (uint16_t*)mrb_malloc(mrb, sizeof(short)*s->icapa);
3102  }
3103  s->lineno = prev->lineno;
3104 
3105  /* debug setting */
3106  s->debug_start_pos = 0;
3107  if (s->filename_sym) {
3108  mrb_debug_info_alloc(mrb, s->irep);
3109  }
3110  else {
3111  s->irep->debug_info = NULL;
3112  }
3113  s->parser = prev->parser;
3114  s->filename_index = prev->filename_index;
3115 
3116  s->rlev = prev->rlev+1;
3117 
3118  return s;
3119 }
3120 
3121 static void
3123 {
3124  mrb_state *mrb = s->mrb;
3125  mrb_irep *irep = s->irep;
3126 
3127  if (s->nlocals > 0xff) {
3128  codegen_error(s, "too many local variables");
3129  }
3130  irep->flags = 0;
3131  if (s->iseq) {
3132  size_t catchsize = sizeof(struct mrb_irep_catch_handler) * irep->clen;
3133  irep->iseq = (const mrb_code *)codegen_realloc(s, s->iseq, sizeof(mrb_code)*s->pc + catchsize);
3134  irep->ilen = s->pc;
3135  if (irep->clen > 0) {
3136  memcpy((void *)(irep->iseq + irep->ilen), s->catch_table, catchsize);
3137  }
3138  }
3139  else {
3140  irep->clen = 0;
3141  }
3142  mrb_free(s->mrb, s->catch_table);
3143  s->catch_table = NULL;
3144  irep->pool = (const mrb_pool_value*)codegen_realloc(s, s->pool, sizeof(mrb_pool_value)*irep->plen);
3145  irep->syms = (const mrb_sym*)codegen_realloc(s, s->syms, sizeof(mrb_sym)*irep->slen);
3146  irep->reps = (const mrb_irep**)codegen_realloc(s, s->reps, sizeof(mrb_irep*)*irep->rlen);
3147  if (s->filename_sym) {
3148  mrb_sym fname = mrb_parser_get_filename(s->parser, s->filename_index);
3149  const char *filename = mrb_sym_name_len(s->mrb, fname, NULL);
3150 
3151  mrb_debug_info_append_file(s->mrb, s->irep->debug_info,
3152  filename, s->lines, s->debug_start_pos, s->pc);
3153  }
3154  mrb_free(s->mrb, s->lines);
3155 
3156  irep->nlocals = s->nlocals;
3157  irep->nregs = s->nregs;
3158 
3159  mrb_gc_arena_restore(mrb, s->ai);
3160  mrb_pool_close(s->mpool);
3161 }
3162 
3163 static struct loopinfo*
3165 {
3166  struct loopinfo *p = (struct loopinfo *)codegen_palloc(s, sizeof(struct loopinfo));
3167 
3168  p->type = t;
3169  p->pc0 = p->pc1 = p->pc2 = p->pc3 = JMPLINK_START;
3170  p->prev = s->loop;
3171  p->acc = cursp();
3172  s->loop = p;
3173 
3174  return p;
3175 }
3176 
3177 static void
3179 {
3180  if (!s->loop) {
3181  codegen(s, tree, NOVAL);
3182  raise_error(s, "unexpected break");
3183  }
3184  else {
3185  struct loopinfo *loop;
3186 
3187  if (tree) {
3188  gen_retval(s, tree);
3189  }
3190 
3191  loop = s->loop;
3192  while (loop) {
3193  if (loop->type == LOOP_BEGIN) {
3194  loop = loop->prev;
3195  }
3196  else if (loop->type == LOOP_RESCUE) {
3197  loop = loop->prev;
3198  }
3199  else{
3200  break;
3201  }
3202  }
3203  if (!loop) {
3204  raise_error(s, "unexpected break");
3205  return;
3206  }
3207 
3208  if (loop->type == LOOP_NORMAL) {
3209  int tmp;
3210 
3211  if (tree) {
3212  gen_move(s, loop->acc, cursp(), 0);
3213  }
3214  tmp = genjmp(s, OP_JMPUW, loop->pc3);
3215  loop->pc3 = tmp;
3216  }
3217  else {
3218  if (!tree) {
3219  genop_1(s, OP_LOADNIL, cursp());
3220  }
3221  gen_return(s, OP_BREAK, cursp());
3222  }
3223  }
3224 }
3225 
3226 static void
3228 {
3229  if (val) {
3230  genop_1(s, OP_LOADNIL, cursp());
3231  }
3232  dispatch_linked(s, s->loop->pc3);
3233  s->loop = s->loop->prev;
3234  if (val) push();
3235 }
3236 
3237 static int
3239 {
3240  size_t newsize = sizeof(struct mrb_irep_catch_handler) * (s->irep->clen + 1);
3241  s->catch_table = (struct mrb_irep_catch_handler *)codegen_realloc(s, (void *)s->catch_table, newsize);
3242  return s->irep->clen ++;
3243 }
3244 
3245 static void
3247 {
3248  struct mrb_irep_catch_handler *e;
3249 
3250  mrb_assert(ent >= 0 && ent < s->irep->clen);
3251 
3252  e = &s->catch_table[ent];
3253  uint8_to_bin(type, &e->type);
3257 }
3258 
3259 static struct RProc*
3261 {
3262  codegen_scope *scope = scope_new(mrb, 0, 0);
3263  struct RProc *proc;
3264  struct mrb_jmpbuf *prev_jmp = mrb->jmp;
3265 
3266  scope->mrb = mrb;
3267  scope->parser = p;
3268  scope->filename_sym = p->filename_sym;
3269  scope->filename_index = p->current_filename_index;
3270 
3271  MRB_TRY(&scope->jmp) {
3272  mrb->jmp = &scope->jmp;
3273  /* prepare irep */
3274  codegen(scope, p->tree, val);
3275  proc = mrb_proc_new(mrb, scope->irep);
3276  mrb_irep_decref(mrb, scope->irep);
3278  proc->c = NULL;
3279  if (mrb->c->cibase && mrb->c->cibase->proc == proc->upper) {
3280  proc->upper = NULL;
3281  }
3282  mrb->jmp = prev_jmp;
3283  return proc;
3284  }
3285  MRB_CATCH(&scope->jmp) {
3286  mrb_irep_decref(mrb, scope->irep);
3288  mrb->jmp = prev_jmp;
3289  return NULL;
3290  }
3291  MRB_END_EXC(&scope->jmp);
3292 }
3293 
3294 MRB_API struct RProc*
3296 {
3297  return generate_code(mrb, p, VAL);
3298 }
3299 
3300 void
3302 {
3303  int i;
3304 
3305  if (irep->flags & MRB_IREP_NO_FREE) return;
3306  if (irep->lv) {
3307  mrb_free(mrb, (void*)irep->lv);
3308  irep->lv = NULL;
3309  }
3310  if (!irep->reps) return;
3311  for (i = 0; i < irep->rlen; ++i) {
3313  }
3314 }
3315 
3316 #undef OPCODE
3317 #define Z 1
3318 #define S 3
3319 #define W 4
3320 /* instruction sizes */
3322 #define B 2
3323 #define BB 3
3324 #define BBB 4
3325 #define BS 4
3326 #define BSS 6
3327 #define SB 4
3328 #define OPCODE(_,x) x,
3329 #include "mruby/ops.h"
3330 #undef OPCODE
3331 #undef B
3332 #undef BB
3333 #undef BS
3334 #undef BSS
3335 #undef SB
3336 #undef BBB
3337 };
return _Result< 0 ? -1 :_Result;} #line 1069 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnwprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1091 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, va_list _ArgList) { return _vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1108 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _ArgList) { return _vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1133 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1179 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1196 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __vswprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1212 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf(wchar_t *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1227 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1243 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1264 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1281 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1283 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1312 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1347 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_l(_Format,((void *) 0), _ArgList);} #line 1361 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1380 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1394 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __swprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1414 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1435 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf(wchar_t *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1454 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1474 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "__swprintf_l_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __swprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vswprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __vswprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "swprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swprintf(wchar_t *_Buffer, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vswprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vswprintf(wchar_t *_Buffer, wchar_t const *_Format, va_list _Args);__inline int __cdecl _swprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1511 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1532 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1534 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1562 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1582 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1603 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1623 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1646 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1668 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1711 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1737 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1755 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1774 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1792 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #pragma warning(push) #pragma warning(disable:4141 6054) #pragma warning(pop) #line 1856 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" int __cdecl __stdio_common_vswscanf(unsigned __int64 _Options, wchar_t const *_Buffer, size_t _BufferCount, wchar_t const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vswscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1897 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf(wchar_t const *_Buffer, wchar_t const *_Format, va_list _ArgList) { return _vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1947 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1949 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1976 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1995 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_swscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2015 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "swscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl swscanf(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2034 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2054 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 2077 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2100 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2122 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2143 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) typedef __int64 fpos_t;errno_t __cdecl _get_stream_buffer_pointers(FILE *_Stream, char ***_Base, char ***_Pointer, int **_Count);errno_t __cdecl clearerr_s(FILE *_Stream);errno_t __cdecl fopen_s(FILE **_Stream, char const *_FileName, char const *_Mode);size_t __cdecl fread_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);errno_t __cdecl freopen_s(FILE **_Stream, char const *_FileName, char const *_Mode, FILE *_OldStream);char *__cdecl gets_s(char *_Buffer, rsize_t _Size);errno_t __cdecl tmpfile_s(FILE **_Stream);errno_t __cdecl tmpnam_s(char *_Buffer, rsize_t _Size);#line 145 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl clearerr(FILE *_Stream);int __cdecl fclose(FILE *_Stream);int __cdecl _fcloseall(void);FILE *__cdecl _fdopen(int _FileHandle, char const *_Mode);int __cdecl feof(FILE *_Stream);int __cdecl ferror(FILE *_Stream);int __cdecl fflush(FILE *_Stream);int __cdecl fgetc(FILE *_Stream);int __cdecl _fgetchar(void);int __cdecl fgetpos(FILE *_Stream, fpos_t *_Position);char *__cdecl fgets(char *_Buffer, int _MaxCount, FILE *_Stream);int __cdecl _fileno(FILE *_Stream);int __cdecl _flushall(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "fopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl fopen(char const *_FileName, char const *_Mode);int __cdecl fputc(int _Character, FILE *_Stream);int __cdecl _fputchar(int _Character);int __cdecl fputs(char const *_Buffer, FILE *_Stream);size_t __cdecl fread(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);__declspec(deprecated("This function or variable may be unsafe. Consider using " "freopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl freopen(char const *_FileName, char const *_Mode, FILE *_Stream);FILE *__cdecl _fsopen(char const *_FileName, char const *_Mode, int _ShFlag);int __cdecl fsetpos(FILE *_Stream, fpos_t const *_Position);int __cdecl fseek(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl ftell(FILE *_Stream);__int64 __cdecl _ftelli64(FILE *_Stream);size_t __cdecl fwrite(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl getc(FILE *_Stream);int __cdecl getchar(void);int __cdecl _getmaxstdio(void);int __cdecl _getw(FILE *_Stream);void __cdecl perror(char const *_ErrorMessage);int __cdecl _pclose(FILE *_Stream);FILE *__cdecl _popen(char const *_Command, char const *_Mode);#line 344 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl putc(int _Character, FILE *_Stream);int __cdecl putchar(int _Character);int __cdecl puts(char const *_Buffer);int __cdecl _putw(int _Word, FILE *_Stream);int __cdecl remove(char const *_FileName);int __cdecl rename(char const *_OldFileName, char const *_NewFileName);int __cdecl _unlink(char const *_FileName);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_unlink" ". See online help for details.")) int __cdecl unlink(char const *_FileName);#line 391 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl rewind(FILE *_Stream);int __cdecl _rmtmp(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "setvbuf" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) void __cdecl setbuf(FILE *_Stream, char *_Buffer);int __cdecl _setmaxstdio(int _Maximum);int __cdecl setvbuf(FILE *_Stream, char *_Buffer, int _Mode, size_t _Size);__declspec(allocator) char *__cdecl _tempnam(char const *_DirectoryName, char const *_FilePrefix);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpfile_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl tmpfile(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpnam_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl tmpnam(char *_Buffer);int __cdecl ungetc(int _Character, FILE *_Stream);void __cdecl _lock_file(FILE *_Stream);void __cdecl _unlock_file(FILE *_Stream);int __cdecl _fclose_nolock(FILE *_Stream);int __cdecl _fflush_nolock(FILE *_Stream);int __cdecl _fgetc_nolock(FILE *_Stream);int __cdecl _fputc_nolock(int _Character, FILE *_Stream);size_t __cdecl _fread_nolock(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);size_t __cdecl _fread_nolock_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _fseek_nolock(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64_nolock(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl _ftell_nolock(FILE *_Stream);__int64 __cdecl _ftelli64_nolock(FILE *_Stream);size_t __cdecl _fwrite_nolock(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _getc_nolock(FILE *_Stream);int __cdecl _putc_nolock(int _Character, FILE *_Stream);int __cdecl _ungetc_nolock(int _Character, FILE *_Stream);int *__cdecl __p__commode(void);#line 596 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_s(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_p(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vfprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 648 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 662 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_s((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 677 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 693 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 695 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_p((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 710 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);} #line 724 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 738 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf(char const *const _Format, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 751 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 765 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf_s(char const *const _Format, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 780 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 796 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p(char const *const _Format, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 809 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 828 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 846 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl _set_printf_count_output(int _Value);int __cdecl _get_printf_count_output(void);__inline int __cdecl _fprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 871 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 891 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 893 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 948 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 965 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 983 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1002 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1004 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1022 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1039 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfscanf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _Arglist);__inline int __cdecl _vfscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options()), _Stream, _Format, _Locale, _ArgList);} #line 1070 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1084 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Stream, _Format, _Locale, _ArgList);} #line 1101 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1118 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1120 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1134 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf(char const *const _Format, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1147 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1161 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf_s(char const *const _Format, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1176 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1178 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_fscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _fscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1197 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "fscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl fscanf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1215 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1234 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fscanf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1254 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_scanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _scanf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1274 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "scanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl scanf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1291 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scanf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1309 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl scanf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1330 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsprintf(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, size_t _MaxCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_p(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1399 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1415 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);return _Result< 0 ? -1 :_Result;} #line 1446 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1462 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl vsprintf(char *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1477 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1498 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1516 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1526 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1547 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1563 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1585 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1602 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1630 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1641 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1659 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf(char const *const _Format, va_list _ArgList) { return _vscprintf_l(_Format,((void *) 0), _ArgList);} #line 1672 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p(char const *const _Format, va_list _ArgList) { return _vscprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1703 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1723 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1739 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1761 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf(char *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl sprintf(char *_Buffer, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl vsprintf(char *_Buffer, char const *_Format, va_list _Args);__inline int __cdecl _sprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1810 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1832 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1834 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1862 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1882 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1905 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1936 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1956 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _snprintf(char *_Buffer, size_t _BufferCount, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _vsnprintf(char *_Buffer, size_t _BufferCount, char const *_Format, va_list _Args);__inline int __cdecl _snprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1986 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2006 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2028 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2049 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2092 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2110 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p(_Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2127 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsscanf(unsigned __int64 _Options, char const *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vsscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2158 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsscanf(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2172 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2189 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __inline int __cdecl vsscanf_s(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2208 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) #line 2219 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2238 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl sscanf(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2275 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sscanf_s(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsscanf_s(_Buffer, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2297 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 2299 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2326 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2349 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2374 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2397 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) __declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_tempnam" ". See online help for details.")) char *__cdecl tempnam(char const *_Directory, char const *_FilePrefix);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fcloseall" ". See online help for details.")) int __cdecl fcloseall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fdopen" ". See online help for details.")) FILE *__cdecl fdopen(int _FileHandle, char const *_Format);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fgetchar" ". See online help for details.")) int __cdecl fgetchar(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fileno" ". See online help for details.")) int __cdecl fileno(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_flushall" ". See online help for details.")) int __cdecl flushall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fputchar" ". See online help for details.")) int __cdecl fputchar(int _Ch);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_getw" ". See online help for details.")) int __cdecl getw(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_putw" ". See online help for details.")) int __cdecl putw(int _Ch, FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_rmtmp" ". See online help for details.")) int __cdecl rmtmp(void);#line 2441 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h"__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma once#pragma once#pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int *__cdecl _errno(void);errno_t __cdecl _set_errno(int _Value);errno_t __cdecl _get_errno(int *_Value);unsigned long *__cdecl __doserrno(void);errno_t __cdecl _set_doserrno(unsigned long _Value);errno_t __cdecl _get_doserrno(unsigned long *_Value);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) void *__cdecl memchr(void const *_Buf, int _Val, size_t _MaxCount);int __cdecl memcmp(void const *_Buf1, void const *_Buf2, size_t _Size);void *__cdecl memcpy(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memmove(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memset(void *_Dst, int _Val, size_t _Size);char *__cdecl strchr(char const *_Str, int _Val);char *__cdecl strrchr(char const *_Str, int _Ch);char *__cdecl strstr(char const *_Str, char const *_SubStr);wchar_t *__cdecl wcschr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsrchr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsstr(wchar_t const *_Str, wchar_t const *_SubStr);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) static __inline errno_t __cdecl memcpy_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;if(_Source==((void *) 0)||_DestinationSize< _SourceSize) { memset(_Destination, 0, _DestinationSize);{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;return 22 ;} memcpy(_Destination, _Source, _SourceSize);return 0;} static __inline errno_t __cdecl memmove_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;memmove(_Destination, _Source, _SourceSize);return 0;}#pragma warning(pop) __pragma(pack(pop))#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int __cdecl _memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);int __cdecl _memicmp_l(void const *_Buf1, void const *_Buf2, size_t _Size, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memccpy" ". See online help for details.")) void *__cdecl memccpy(void *_Dst, void const *_Src, int _Val, size_t _Size);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memicmp" ". See online help for details.")) int __cdecl memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl wcscat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcscpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcsncat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);errno_t __cdecl wcsncpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);wchar_t *__cdecl wcstok_s(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);__declspec(allocator) wchar_t *__cdecl _wcsdup(wchar_t const *_String);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscat(wchar_t *_Destination, wchar_t const *_Source);int __cdecl wcscmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscpy(wchar_t *_Destination, wchar_t const *_Source);size_t __cdecl wcscspn(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcslen(wchar_t const *_String);size_t __cdecl wcsnlen(wchar_t const *_Source, size_t _MaxCount);static __inline size_t __cdecl wcsnlen_s(wchar_t const *_Source, size_t _MaxCount) { return(_Source==0) ? 0 :wcsnlen(_Source, _MaxCount);}__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncat(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);int __cdecl wcsncmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncpy(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);wchar_t *__cdecl wcspbrk(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcsspn(wchar_t const *_String, wchar_t const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcstok(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);#line 237 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstring.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) static __inline wchar_t *__cdecl _wcstok(wchar_t *const _String, wchar_t const *const _Delimiter) { return wcstok(_String, _Delimiter, 0);} __declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcserror(int _ErrorNumber);errno_t __cdecl _wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, int _ErrorNumber);__declspec(deprecated("This function or variable may be unsafe. Consider using " "__wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl __wcserror(wchar_t const *_String);errno_t __cdecl __wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, wchar_t const *_ErrorMessage);int __cdecl _wcsicmp(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicmp_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicmp_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);errno_t __cdecl _wcsnset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);wchar_t *__cdecl _wcsrev(wchar_t *_String);errno_t __cdecl _wcsset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsset(wchar_t *_String, wchar_t _Value);errno_t __cdecl _wcslwr_s(wchar_t *_String, size_t _SizeInWords);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr(wchar_t *_String);errno_t __cdecl _wcslwr_s_l(wchar_t *_String, size_t _SizeInWords, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr_l(wchar_t *_String, _locale_t _Locale);errno_t __cdecl _wcsupr_s(wchar_t *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr(wchar_t *_String);errno_t __cdecl _wcsupr_s_l(wchar_t *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr_l(wchar_t *_String, _locale_t _Locale);size_t __cdecl wcsxfrm(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount);size_t __cdecl _wcsxfrm_l(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount, _locale_t _Locale);int __cdecl wcscoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcscoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsicoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsncoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsncoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _wcsnicoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsdup" ". See online help for details.")) wchar_t *__cdecl wcsdup(wchar_t const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicmp" ". See online help for details.")) int __cdecl wcsicmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnicmp" ". See online help for details.")) int __cdecl wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnset" ". See online help for details.")) wchar_t *__cdecl wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsrev" ". See online help for details.")) wchar_t *__cdecl wcsrev(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsset" ". See online help for details.")) wchar_t *__cdecl wcsset(wchar_t *_String, wchar_t _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcslwr" ". See online help for details.")) wchar_t *__cdecl wcslwr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsupr" ". See online help for details.")) wchar_t *__cdecl wcsupr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicoll" ". See online help for details.")) int __cdecl wcsicoll(wchar_t const *_String1, wchar_t const *_String2);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl strcpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strcat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strerror_s(char *_Buffer, size_t _SizeInBytes, int _ErrorNumber);errno_t __cdecl strncat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);errno_t __cdecl strncpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);char *__cdecl strtok_s(char *_String, char const *_Delimiter, char **_Context);void *__cdecl _memccpy(void *_Dst, void const *_Src, int _Val, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcat(char *_Destination, char const *_Source);int __cdecl strcmp(char const *_Str1, char const *_Str2);int __cdecl _strcmpi(char const *_String1, char const *_String2);int __cdecl strcoll(char const *_String1, char const *_String2);int __cdecl _strcoll_l(char const *_String1, char const *_String2, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcpy(char *_Destination, char const *_Source);size_t __cdecl strcspn(char const *_Str, char const *_Control);__declspec(allocator) char *__cdecl _strdup(char const *_Source);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strerror(char const *_ErrorMessage);errno_t __cdecl _strerror_s(char *_Buffer, size_t _SizeInBytes, char const *_ErrorMessage);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strerror(int _ErrorMessage);int __cdecl _stricmp(char const *_String1, char const *_String2);int __cdecl _stricoll(char const *_String1, char const *_String2);int __cdecl _stricoll_l(char const *_String1, char const *_String2, _locale_t _Locale);int __cdecl _stricmp_l(char const *_String1, char const *_String2, _locale_t _Locale);size_t __cdecl strlen(char const *_Str);errno_t __cdecl _strlwr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr(char *_String);errno_t __cdecl _strlwr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr_l(char *_String, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncat(char *_Destination, char const *_Source, size_t _Count);int __cdecl strncmp(char const *_Str1, char const *_Str2, size_t _MaxCount);int __cdecl _strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicmp_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strnicoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strncoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strncoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);size_t __cdecl __strncnt(char const *_String, size_t _Count);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncpy(char *_Destination, char const *_Source, size_t _Count);size_t __cdecl strnlen(char const *_String, size_t _MaxCount);static __inline size_t __cdecl strnlen_s(char const *_String, size_t _MaxCount) { return _String==0 ? 0 :strnlen(_String, _MaxCount);} errno_t __cdecl _strnset_s(char *_String, size_t _SizeInBytes, int _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strnset(char *_Destination, int _Value, size_t _Count);char *__cdecl strpbrk(char const *_Str, char const *_Control);char *__cdecl _strrev(char *_Str);errno_t __cdecl _strset_s(char *_Destination, size_t _DestinationSize, int _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strset(char *_Destination, int _Value);size_t __cdecl strspn(char const *_Str, char const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strtok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strtok(char *_String, char const *_Delimiter);errno_t __cdecl _strupr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr(char *_String);errno_t __cdecl _strupr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr_l(char *_String, _locale_t _Locale);size_t __cdecl strxfrm(char *_Destination, char const *_Source, size_t _MaxCount);size_t __cdecl _strxfrm_l(char *_Destination, char const *_Source, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strdup" ". See online help for details.")) char *__cdecl strdup(char const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strcmpi" ". See online help for details.")) int __cdecl strcmpi(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_stricmp" ". See online help for details.")) int __cdecl stricmp(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strlwr" ". See online help for details.")) char *__cdecl strlwr(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnicmp" ". See online help for details.")) int __cdecl strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnset" ". See online help for details.")) char *__cdecl strnset(char *_String, int _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strrev" ". See online help for details.")) char *__cdecl strrev(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strset" ". See online help for details.")) char *__cdecl strset(char *_String, int _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strupr" ". See online help for details.")) char *__cdecl strupr(char *_String);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) __pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) typedef unsigned short _ino_t;typedef _ino_t ino_t;#line 24 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef unsigned int _dev_t;typedef _dev_t dev_t;#line 36 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef long _off_t;typedef _off_t off_t;#line 48 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h"#pragma warning(pop) typedef char *sds;#pragma pack(push, 1) struct sdshdr5 { unsigned char flags;char buf[];};struct sdshdr8 { uint8_t len;uint8_t alloc;unsigned char flags;char buf[];};struct sdshdr16 { uint16_t len;uint16_t alloc;unsigned char flags;char buf[];};struct sdshdr32 { uint32_t len;uint32_t alloc;unsigned char flags;char buf[];};struct sdshdr64 { uint64_t len;uint64_t alloc;unsigned char flags;char buf[];};#pragma pack(pop) static inline size_t sdslen(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :return((flags) >> 3) ;case 1 :return((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len;case 2 :return((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len;case 3 :return((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) ->len;case 4 :return((struct sdshdr64 *)((s) -(sizeof(struct sdshdr64)))) ->len;} return 0;}static inline size_t sdsavail(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ return 0;} case 1 :{ struct sdshdr8 *sh=(void *)((s) -(sizeof(struct sdshdr8)));;return sh->alloc - sh->len;} case 2 :{ struct sdshdr16 *sh=(void *)((s) -(sizeof(struct sdshdr16)));;return sh->alloc - sh->len;} case 3 :{ struct sdshdr32 *sh=(void *)((s) -(sizeof(struct sdshdr32)));;return sh->alloc - sh->len;} case 4 :{ struct sdshdr64 *sh=(void *)((s) -(sizeof(struct sdshdr64)));;return sh->alloc - sh->len;} } return 0;}static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ unsigned char *fp=((unsigned char *) s) - 1;*fp=0|(newlen<< 3);} break;case 1 :((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len=(uint8_t) newlen;break;case 2 :((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len=(uint16_t) newlen;break;case 3 :((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) -> len
Definition: CPAL.d:15583
NSAutoreleasePool * pool
#define message
Definition: aptex-macros.h:418
#define type(a)
Definition: aptex-macros.h:171
#define name
#define tail
Definition: aptex-macros.h:514
#define call
Definition: aptex-macros.h:493
char * p2
Definition: bmpfont.h:62
char * p1
Definition: bmpfont.h:62
#define mrb_integer(o)
Definition: boxing_nan.h:71
MRB_INLINE enum mrb_vtype mrb_type(mrb_value o)
Definition: boxing_word.h:195
short pos1(char c, char *s)
Definition: cfuncs.c:30
#define n
Definition: t4ht.c:1290
static int lambda_body(codegen_scope *s, node *tree, int blk)
Definition: codegen.c:827
static void scope_add_irep(codegen_scope *s)
Definition: codegen.c:3025
static void genop_2SS(codegen_scope *s, mrb_code i, uint16_t a, uint32_t b)
Definition: codegen.c:298
static int scope_body(codegen_scope *s, node *tree, int val)
Definition: codegen.c:1004
static void genop_1(codegen_scope *s, mrb_code i, uint16_t a)
Definition: codegen.c:236
static int catch_handler_new(codegen_scope *s)
Definition: codegen.c:3238
static void genop_0(codegen_scope *s, mrb_code i)
Definition: codegen.c:229
static void genop_bs(codegen_scope *s, mrb_code i, uint16_t a, uint16_t b)
Definition: codegen.c:265
static void codegen(codegen_scope *s, node *tree, int val)
Definition: codegen.c:1468
struct scope codegen_scope
#define JMPLINK_START
Definition: codegen.c:372
static void gen_literal_array(codegen_scope *s, node *tree, mrb_bool sym, int val)
Definition: codegen.c:1349
uint8_t mrb_insn_size[]
Definition: codegen.c:3321
static void dispatch_linked(codegen_scope *s, uint32_t pos)
Definition: codegen.c:557
static int search_upvar(codegen_scope *s, mrb_sym id, int *idx)
Definition: codegen.c:746
static struct RProc * generate_code(mrb_state *mrb, parser_state *p, int val)
Definition: codegen.c:3260
static int node_len(node *tree)
Definition: codegen.c:714
void mrb_irep_remove_lv(mrb_state *mrb, mrb_irep *irep)
Definition: codegen.c:3301
static void emit_S(codegen_scope *s, int pc, uint16_t i)
Definition: codegen.c:205
static void genop_3(codegen_scope *s, mrb_code i, uint16_t a, uint16_t b, uint8_t c)
Definition: codegen.c:284
static void loop_pop(codegen_scope *s, int val)
Definition: codegen.c:3227
#define pop_n(n)
Definition: codegen.c:589
static void genop_W(codegen_scope *s, mrb_code i, uint32_t a)
Definition: codegen.c:306
struct mrb_insn_data mrb_decode_insn(const mrb_code *pc)
Definition: codegen.c:331
static void catch_handler_set(codegen_scope *s, int ent, enum mrb_catch_type type, uint32_t begin, uint32_t end, uint32_t target)
Definition: codegen.c:3246
static int new_lit(codegen_scope *s, mrb_value val)
Definition: codegen.c:593
static void loop_break(codegen_scope *s, node *tree)
Definition: codegen.c:3178
mrb_ast_node node
Definition: codegen.c:30
static void gen_jmpdst(codegen_scope *s, uint32_t pc)
Definition: codegen.c:375
static void genop_2S(codegen_scope *s, mrb_code i, uint16_t a, uint16_t b)
Definition: codegen.c:291
static void gen_addsub(codegen_scope *s, uint8_t op, uint16_t dst)
Definition: codegen.c:498
#define genjmp2_0(s, i, a, val)
Definition: codegen.c:434
#define push_n(n)
Definition: codegen.c:587
static mrb_bool no_peephole(codegen_scope *s)
Definition: codegen.c:367
#define VAL
Definition: codegen.c:320
#define nchar(x)
Definition: codegen.c:726
static void gen_intern(codegen_scope *s)
Definition: codegen.c:1341
static void gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
Definition: codegen.c:1290
static void * codegen_palloc(codegen_scope *s, size_t len)
Definition: codegen.c:154
#define CALL_MAXARGS
Definition: codegen.c:1052
static mrb_bool no_optimize(codegen_scope *s)
Definition: codegen.c:323
static uint32_t genjmp(codegen_scope *s, mrb_code i, uint32_t pc)
Definition: codegen.c:393
#define lv_name(lv)
Definition: codegen.c:729
static void gen_move(codegen_scope *s, uint16_t dst, uint16_t src, int nopeep)
Definition: codegen.c:437
struct RProc * mrb_generate_code(mrb_state *mrb, parser_state *p)
Definition: codegen.c:3295
static int new_sym(codegen_scope *s, mrb_sym sym)
Definition: codegen.c:692
static void gen_B(codegen_scope *s, uint8_t i)
Definition: codegen.c:215
static uint32_t dispatch(codegen_scope *s, uint32_t pos0)
Definition: codegen.c:536
static struct loopinfo * loop_push(codegen_scope *s, enum looptype t)
Definition: codegen.c:3164
static void gen_assignment(codegen_scope *s, node *tree, int sp, int val)
Definition: codegen.c:1211
#define nint(x)
Definition: codegen.c:725
static void * codegen_realloc(codegen_scope *s, void *p, size_t len)
Definition: codegen.c:163
static int gen_values(codegen_scope *s, node *t, int val, int extra)
Definition: codegen.c:1055
#define NOVAL
Definition: codegen.c:319
static mrb_bool nosplat(node *t)
Definition: codegen.c:1022
static void codegen_error(codegen_scope *s, const char *message)
Definition: codegen.c:112
#define cursp()
Definition: codegen.c:590
static int new_label(codegen_scope *s)
Definition: codegen.c:172
static struct mrb_insn_data mrb_last_insn(codegen_scope *s)
Definition: codegen.c:355
static void gen_S(codegen_scope *s, uint16_t i)
Definition: codegen.c:222
#define nregs_update
Definition: codegen.c:566
static void pop_n_(codegen_scope *s, int n)
Definition: codegen.c:578
#define pop()
Definition: codegen.c:588
looptype
Definition: codegen.c:33
@ LOOP_BLOCK
Definition: codegen.c:35
@ LOOP_FOR
Definition: codegen.c:36
@ LOOP_BEGIN
Definition: codegen.c:37
@ LOOP_NORMAL
Definition: codegen.c:34
@ LOOP_RESCUE
Definition: codegen.c:38
#define genjmp_0(s, i)
Definition: codegen.c:404
static void scope_finish(codegen_scope *s)
Definition: codegen.c:3122
static void for_body(codegen_scope *s, node *tree)
Definition: codegen.c:785
#define MRB_CODEGEN_LEVEL_MAX
Definition: codegen.c:25
static mrb_int readint_mrb_int(codegen_scope *s, const char *p, int base, mrb_bool neg, mrb_bool *overflow)
Definition: codegen.c:1411
static void emit_B(codegen_scope *s, uint32_t pc, uint8_t i)
Definition: codegen.c:178
#define push()
Definition: codegen.c:586
static uint32_t genjmp2(codegen_scope *s, mrb_code i, uint16_t a, uint32_t pc, int val)
Definition: codegen.c:407
static void raise_error(codegen_scope *s, const char *msg)
Definition: codegen.c:1403
static mrb_sym attrsym(codegen_scope *s, mrb_sym a)
Definition: codegen.c:1032
static int lv_idx(codegen_scope *s, mrb_sym id)
Definition: codegen.c:732
static void gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe)
Definition: codegen.c:1119
static void genop_2(codegen_scope *s, mrb_code i, uint16_t a, uint16_t b)
Definition: codegen.c:249
static void push_n_(codegen_scope *s, int n)
Definition: codegen.c:568
static void gen_retval(codegen_scope *s, node *tree)
Definition: codegen.c:1454
static codegen_scope * scope_new(mrb_state *mrb, codegen_scope *prev, node *lv)
Definition: codegen.c:3050
static void gen_return(codegen_scope *s, uint8_t op, uint16_t src)
Definition: codegen.c:479
#define nsym(x)
Definition: codegen.c:727
#define b
Definition: jpegint.h:372
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define MRB_OPSYM_2(mrb, name)
Definition: disable.h:22
#define MRB_SYM_2(mrb, name)
Definition: disable.h:28
#define MRB_SYM_Q_2(mrb, name)
Definition: disable.h:26
long pc
Definition: disdvi.c:114
static size_t uint8_to_bin(uint8_t s, uint8_t *bin)
Definition: dump.h:110
int v
Definition: dviconv.c:10
#define skip(p, c)
Definition: ptexmac.h:70
#define nil
Definition: dvi2tty.h:53
struct rect data
Definition: dvipdfm.c:64
void replace(char *, char *)
Definition: dvispc.c:2100
mpz_t * f
Definition: gen-fib.c:34
#define a1
#define a2
#define a3
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
static FIELD_PTR prev
Definition: genind.c:36
static FIELD_PTR begin
Definition: genind.c:37
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
int base
Definition: gsftopk.c:1502
#define memcmp(s1, s2, n)
Definition: gsftopk.c:66
#define memcpy(d, s, n)
Definition: gsftopk.c:64
#define PEEK_S(pc)
Definition: opcode.h:27
#define READ_B()
Definition: opcode.h:30
void mrb_irep_decref(mrb_state *, struct mrb_irep *)
Definition: state.c:117
#define IREP_TT_NFLAG
Definition: irep.h:26
#define mrb_irep_catch_handler_pack(n, v)
Definition: irep.h:142
#define MRB_IREP_NO_FREE
Definition: irep.h:83
mrb_irep * mrb_add_irep(mrb_state *mrb)
Definition: state.c:196
mrb_catch_type
Definition: irep.h:43
@ MRB_CATCH_RESCUE
Definition: irep.h:44
@ MRB_CATCH_ENSURE
Definition: irep.h:45
@ IREP_TT_STR
Definition: irep.h:19
@ IREP_TT_INT32
Definition: irep.h:21
@ IREP_TT_FLOAT
Definition: irep.h:23
@ IREP_TT_INT64
Definition: irep.h:22
@ IREP_TT_SSTR
Definition: irep.h:20
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific f u
Definition: afcover.h:88
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
FT_UInt idx
Definition: cffcmap.c:135
#define const
Definition: ftzconf.h:91
void exit()
#define INT32_MAX
Definition: stdint.h:137
signed short int16_t
Definition: stdint.h:76
unsigned short uint16_t
Definition: stdint.h:79
#define SIZE_MAX
Definition: stdint.h:206
#define UINT16_MAX
Definition: stdint.h:141
unsigned int uint32_t
Definition: stdint.h:80
#define INT32_MIN
Definition: stdint.h:136
uint16_t uint_fast16_t
Definition: stdint.h:109
signed int intptr_t
Definition: stdint.h:118
signed int int32_t
Definition: stdint.h:77
#define UINT32_MAX
Definition: stdint.h:142
unsigned char uint8_t
Definition: stdint.h:78
#define INT16_MAX
Definition: stdint.h:135
#define INT16_MIN
Definition: stdint.h:134
#define buf
#define fprintf
Definition: mendex.h:64
#define normal
Definition: ctangleboot.c:124
void overflow(const char *)
Definition: cwebboot.c:1385
#define loop
Definition: tie.c:8
#define symbol(x)
Definition: web2c-parser.c:71
const int * pos
Definition: combiners.h:905
#define target(code, i)
Definition: lpeg.c:1165
mrb_sym mrb_intern_str(mrb_state *, mrb_value)
Definition: symbol.c:251
void * mrb_pool_alloc(struct mrb_pool *, size_t)
Definition: pool.c:108
#define MRB_ARGS_POST(n)
Definition: mruby.h:861
#define mrb_intern_lit(mrb, lit)
Definition: mruby.h:1102
#define mrb_assert_int_fit(t1, n, t2, max)
Definition: mruby.h:66
void mrb_pool_close(struct mrb_pool *)
Definition: pool.c:77
uint8_t mrb_code
Definition: mruby.h:122
static void mrb_gc_arena_restore(mrb_state *mrb, int idx)
Definition: mruby.h:1239
static int mrb_gc_arena_save(mrb_state *mrb)
Definition: mruby.h:1233
mrb_value mrb_format(mrb_state *mrb, const char *format,...)
Definition: error.c:372
#define MRB_ARGS_OPT(n)
Definition: mruby.h:845
void * mrb_realloc_simple(mrb_state *, void *, size_t)
Definition: gc.c:224
#define mrb_assert(p)
Definition: mruby.h:65
mrb_value mrb_str_new_cstr(mrb_state *, const char *)
Definition: string.c:203
mrb_value mrb_str_new(mrb_state *mrb, const char *p, size_t len)
Definition: string.c:197
void mrb_free(mrb_state *, void *)
Definition: gc.c:288
#define MRB_ARGS_REQ(n)
Definition: mruby.h:837
#define MRB_ARGS_REST()
Definition: mruby.h:858
#define MRB_ARGS_BLOCK()
Definition: mruby.h:869
#define MRB_ARGS_KEY(n1, n2)
Definition: mruby.h:864
void * mrb_malloc(mrb_state *, size_t)
Definition: gc.c:256
struct mrb_pool * mrb_pool_open(mrb_state *)
Definition: pool.c:64
const char * mrb_sym_name_len(mrb_state *, mrb_sym, mrb_int *)
Definition: symbol.c:328
mrb_sym mrb_intern(mrb_state *, const char *, size_t)
Definition: symbol.c:233
dictionary off
Definition: fc-lang.py:226
@ NODE_OR
Definition: node.h:29
@ NODE_LVAR
Definition: node.h:48
@ NODE_FOR
Definition: node.h:20
@ NODE_SPLAT
Definition: node.h:74
@ NODE_REDO
Definition: node.h:23
@ NODE_SYMBOLS
Definition: node.h:99
@ NODE_SCALL
Definition: node.h:38
@ NODE_STR
Definition: node.h:63
@ NODE_DSYM
Definition: node.h:95
@ NODE_REGX
Definition: node.h:67
@ NODE_CVAR
Definition: node.h:53
@ NODE_NEXT
Definition: node.h:22
@ NODE_MODULE
Definition: node.h:83
@ NODE_AND
Definition: node.h:28
@ NODE_MASGN
Definition: node.h:31
@ NODE_CLASS
Definition: node.h:82
@ NODE_CALL
Definition: node.h:37
@ NODE_FALSE
Definition: node.h:92
@ NODE_ARG
Definition: node.h:70
@ NODE_OP_ASGN
Definition: node.h:36
@ NODE_BEGIN
Definition: node.h:25
@ NODE_LITERAL_DELIM
Definition: node.h:97
@ NODE_BLOCK_ARG
Definition: node.h:77
@ NODE_UNTIL
Definition: node.h:18
@ NODE_FCALL
Definition: node.h:39
@ NODE_SUPER
Definition: node.h:40
@ NODE_DXSTR
Definition: node.h:66
@ NODE_KW_REST_ARGS
Definition: node.h:73
@ NODE_RESCUE
Definition: node.h:26
@ NODE_SCOPE
Definition: node.h:12
@ NODE_SCLASS
Definition: node.h:84
@ NODE_HASH
Definition: node.h:44
@ NODE_SYM
Definition: node.h:62
@ NODE_YIELD
Definition: node.h:47
@ NODE_LAMBDA
Definition: node.h:61
@ NODE_BLOCK
Definition: node.h:13
@ NODE_KW_HASH
Definition: node.h:45
@ NODE_TRUE
Definition: node.h:91
@ NODE_CASE
Definition: node.h:15
@ NODE_ARRAY
Definition: node.h:42
@ NODE_SDEF
Definition: node.h:79
@ NODE_ASGN
Definition: node.h:32
@ NODE_RETRY
Definition: node.h:24
@ NODE_DOT3
Definition: node.h:88
@ NODE_RETURN
Definition: node.h:46
@ NODE_BACK_REF
Definition: node.h:56
@ NODE_HEREDOC
Definition: node.h:96
@ NODE_ENSURE
Definition: node.h:27
@ NODE_SELF
Definition: node.h:89
@ NODE_DOT2
Definition: node.h:87
@ NODE_UNDEF
Definition: node.h:81
@ NODE_NTH_REF
Definition: node.h:55
@ NODE_NEGATE
Definition: node.h:60
@ NODE_KW_ARG
Definition: node.h:72
@ NODE_GVAR
Definition: node.h:50
@ NODE_ALIAS
Definition: node.h:80
@ NODE_COLON2
Definition: node.h:85
@ NODE_POSTEXE
Definition: node.h:94
@ NODE_WORDS
Definition: node.h:98
@ NODE_IVAR
Definition: node.h:51
@ NODE_ZSUPER
Definition: node.h:41
@ NODE_DREGX
Definition: node.h:68
@ NODE_IF
Definition: node.h:14
@ NODE_ARGS_TAIL
Definition: node.h:71
@ NODE_XSTR
Definition: node.h:65
@ NODE_BREAK
Definition: node.h:21
@ NODE_COLON3
Definition: node.h:86
@ NODE_CONST
Definition: node.h:52
@ NODE_NIL
Definition: node.h:90
@ NODE_DEF
Definition: node.h:78
@ NODE_DSTR
Definition: node.h:64
@ NODE_WHILE
Definition: node.h:17
@ NODE_INT
Definition: node.h:58
@ NODE_NVAR
Definition: node.h:54
@ NODE_FLOAT
Definition: node.h:59
struct _proc * proc
Definition: obx.h:95
char * filename[256]
Definition: pbmtopk.c:46
#define ra
char * fname
Definition: plain2.c:121
static int offset
Definition: ppmtogif.c:642
#define tolower(ch)
Definition: utype.h:137
#define MRB_API
Definition: common.h:73
mrb_sym mrb_parser_get_filename(struct mrb_parser_state *, uint16_t idx)
Definition: y.tab.c:12729
mrb_irep_debug_info_file * mrb_debug_info_append_file(mrb_state *mrb, mrb_irep_debug_info *info, const char *filename, uint16_t *lines, uint32_t start_pos, uint32_t end_pos)
Definition: debug.c:125
mrb_irep_debug_info * mrb_debug_info_alloc(mrb_state *mrb, mrb_irep *irep)
Definition: debug.c:112
#define MRB_PROC_CFUNC_P(p)
Definition: proc.h:64
struct RProc * mrb_proc_new(mrb_state *, const mrb_irep *)
Definition: proc.c:37
#define MRB_PROC_SCOPE_P(p)
Definition: proc.h:85
@ OP_EQ
Definition: lopcodes.h:209
@ OP_LOADNIL
Definition: lopcodes.h:175
@ OP_SUB
Definition: lopcodes.h:190
@ OP_DIV
Definition: lopcodes.h:194
@ OP_LT
Definition: lopcodes.h:210
@ OP_ADD
Definition: lopcodes.h:189