Unverified Commit 2b1c4e9a authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4179 from bshastry/ossfuzz

ossfuzz: Add simple mruby compile test harness
parents 82b04f92 05b4eaac
keyword___ENCODING__="__ENCODING__"
keyword___FILE__="__FILE__"
keyword___LINE__="__LINE__"
keyword_BEGIN="BEGIN"
keyword_END="END"
keyword_alias="alias"
keyword_and="and"
keyword_begin="begin"
keyword_break="break"
keyword_case="case"
keyword_class="class"
keyword_def="def"
keyword_do="do"
keyword_else="else"
keyword_elsif="elsif"
keyword_end="end"
keyword_ensure="ensure"
keyword_false="false"
keyword_for="for"
keyword_if="if"
keyword_in="in"
keyword_module="module"
keyword_next="next"
keyword_nil="nil"
keyword_not="not"
keyword_or="or"
keyword_redo="redo"
keyword_rescue="rescue"
keyword_retry="retry"
keyword_return="return"
keyword_self="self"
keyword_super="super"
keyword_then="then"
keyword_true="true"
keyword_undef="undef"
keyword_unless="unless"
keyword_until="until"
keyword_when="when"
keyword_while="while"
keyword_yield="yield"
operator_a=" !"
operator_b=" ~"
operator_c=" +"
operator_d=" -"
operator_e=" []"
operator_f=" []="
operator_g=" *"
operator_h=" /"
operator_i=" %"
operator_j=" +-"
operator_k=" >>"
operator_l=" <<"
operator_m=" &"
operator_n=" ^"
operator_o=" |"
operator_p=" <="
operator_q=" <>"
operator_r=" >="
operator_s=" <=>"
operator_t=" =="
operator_u=" ==="
operator_v=" !="
operator_w=" =~"
operator_x=" !~"
operator_y=" &&"
operator_z=" ||"
operator_aa=" .."
operator_ab=" ..."
operator_ac=" ?"
operator_ad=" :"
operator_ae=" ="
operator_af=" %="
operator_ag=" /="
operator_ah=" -="
operator_ai=" +="
operator_aj=" |="
operator_ak=" &="
operator_al=" >>="
operator_am=" <<="
operator_an=" *="
operator_ao=" &&="
operator_ap=" ||="
operator_aq=" **="
operator_ar=" ^="
operator_as=" not"
operator_at=" or"
operator_au=" and"
operator_av=" if"
operator_aw=" unless"
operator_ax=" while"
operator_ay=" until"
operator_az=" begin"
operator_ba=" end"
snippet_1eq1=" 1=1"
snippet_dollar=" $1"
snippet_at=" @a"
snippet_symbol=" :a"
snippet_array=" [1,2]"
snippet_block=" 1.times{|x| x}"
snippet_multi=" 1*1"
string_single_q=" 'a'"
string_dbl_q=" \"a\""
[libfuzzer]
close_fd_mask=3
dict=mruby.dict
#include <stdlib.h>
#include <string.h>
#include <mruby.h>
#include <mruby/compile.h>
int LLVMFuzzerTestOneInput(uint8_t *Data, size_t size) {
if (size < 1) {
return 0;
}
char *code = malloc(size+1);
memcpy(code, Data, size);
code[size] = '\0';
mrb_state *mrb = mrb_open();
mrb_load_string(mrb, code);
mrb_close(mrb);
free(code);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment