This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 39/40] fix compile_rx_or_error


On 05/10/2013 02:53 AM, Tom Tromey wrote:
@@ -1127,17 +1127,14 @@ get_regcomp_error (int code, regex_t *rx)
  }

  /* Compile a regexp and throw an exception on error.  This returns a
-   cleanup to free the resulting pattern on success.  If RX is NULL,
-   this does nothing and returns NULL.  */
+   cleanup to free the resulting pattern on success.  RX must not be
+   NULL.  */

  struct cleanup *
  compile_rx_or_error (regex_t *pattern, const char *rx, const char *message)
  {
    int code;

-  if (!rx)
-    return NULL;
-

Do we need an assert on RX here?

--
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]