src: put `assert()` after var declarations

Microsoft C++ compiler fails when this assert appears before the
declarations. Moved assert to appear after the declarations.

PR-URL: https://github.com/nodejs/http-parser/pull/293
Reviewed-By: Fedor Indutny <fedor@indutny.com>
make-http-max-header-size-gyp-configurable
Jonathan Marler 9 years ago committed by Fedor Indutny
parent 9b0d5b33eb
commit f2c26ee500

@ -2253,12 +2253,13 @@ http_parse_host_char(enum http_host_state s, const char ch) {
static int static int
http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
assert(u->field_set & (1 << UF_HOST));
enum http_host_state s; enum http_host_state s;
const char *p; const char *p;
size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len; size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;
assert(u->field_set & (1 << UF_HOST));
u->field_data[UF_HOST].len = 0; u->field_data[UF_HOST].len = 0;
s = found_at ? s_http_userinfo_start : s_http_host_start; s = found_at ? s_http_userinfo_start : s_http_host_start;

Loading…
Cancel
Save