From 372c8f0487a666c3fb36edc18accba0fba9a2680 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 24 Jul 2010 17:01:45 -0700 Subject: Fixes to benchmark. --- benchmarks/parsestream.upb_table.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'benchmarks/parsestream.upb_table.c') diff --git a/benchmarks/parsestream.upb_table.c b/benchmarks/parsestream.upb_table.c index c6acad9..1e18119 100644 --- a/benchmarks/parsestream.upb_table.c +++ b/benchmarks/parsestream.upb_table.c @@ -17,6 +17,12 @@ static bool initialize() upb_status status = UPB_STATUS_INIT; upb_symtab *s = upb_symtab_new(); upb_symtab_add_descriptorproto(s); + upb_def *fds_def = upb_symtab_lookup( + s, UPB_STRLIT("google.protobuf.FileDescriptorSet")); + if (!fds_def) { + fprintf(stderr, "Couldn't load FileDescriptorSet def"); + } + upb_string *fds_str = upb_strreadfile(MESSAGE_DESCRIPTOR_FILE); if(fds_str == NULL) { fprintf(stderr, "Couldn't read " MESSAGE_DESCRIPTOR_FILE ":"), @@ -26,8 +32,6 @@ static bool initialize() upb_stringsrc *ssrc = upb_stringsrc_new(); upb_stringsrc_reset(ssrc, fds_str); - upb_def *fds_def = upb_symtab_lookup( - s, UPB_STRLIT("google.protobuf.FileDescriptorSet")); upb_decoder *d = upb_decoder_new(upb_downcast_msgdef(fds_def)); upb_decoder_reset(d, upb_stringsrc_bytesrc(ssrc)); -- cgit v1.2.3