[Forensics-changes] [yara] 338/368: Move variable declaration to satisfy VC++

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:55 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.5.0
in repository yara.

commit fc621a24b84f26b961ca436798565fb87b70225a
Author: plusvic <plusvic at gmail.com>
Date:   Mon Jun 20 16:21:11 2016 +0200

    Move variable declaration to satisfy VC++
---
 libyara/compiler.c | 3 +--
 libyara/exec.c     | 3 ++-
 libyara/lexer.c    | 2 +-
 libyara/lexer.l    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libyara/compiler.c b/libyara/compiler.c
index 7b9f333..4c6c735 100644
--- a/libyara/compiler.c
+++ b/libyara/compiler.c
@@ -386,6 +386,7 @@ int _yr_compiler_compile_rules(
   YR_ARENA* arena = NULL;
   YR_RULE null_rule;
   YR_EXTERNAL_VARIABLE null_external;
+  YR_AC_TABLES tables;
 
   int8_t halt = OP_HALT;
   int result;
@@ -417,8 +418,6 @@ int _yr_compiler_compile_rules(
       sizeof(YR_EXTERNAL_VARIABLE),
       NULL);
 
-  YR_AC_TABLES tables;
-
   // Write Aho-Corasick automaton to arena.
   result = yr_ac_compile(
       compiler->automaton,
diff --git a/libyara/exec.c b/libyara/exec.c
index 55ba01e..dfc3e3e 100644
--- a/libyara/exec.c
+++ b/libyara/exec.c
@@ -108,10 +108,11 @@ typedef union _STACK_ITEM {
             block->size >= sizeof(type) && \
             offset <= block->base + block->size - sizeof(type)) \
         { \
+          type result; \
           uint8_t* data = iterator->fetch_data(iterator); \
           if (data == NULL) \
             return UNDEFINED; \
-          type result = *(type *)(data + offset - block->base); \
+          result = *(type *)(data + offset - block->base); \
           result = endianess##_##type(result); \
           return result; \
         } \
diff --git a/libyara/lexer.c b/libyara/lexer.c
index 65b87a7..d80cd0f 100644
--- a/libyara/lexer.c
+++ b/libyara/lexer.c
@@ -3063,11 +3063,11 @@ void yywarning(
 
   char* file_name;
   char message[512];
+  va_list message_args;
 
   if (compiler->callback == NULL)
     return;
 
-  va_list message_args;
   va_start(message_args, message_fmt);
 
   if (compiler->file_name_stack_ptr > 0)
diff --git a/libyara/lexer.l b/libyara/lexer.l
index 512e923..758817c 100644
--- a/libyara/lexer.l
+++ b/libyara/lexer.l
@@ -641,11 +641,11 @@ void yywarning(
 
   char* file_name;
   char message[512];
+  va_list message_args;
 
   if (compiler->callback == NULL)
     return;
 
-  va_list message_args;
   va_start(message_args, message_fmt);
 
   if (compiler->file_name_stack_ptr > 0)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list