[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/02: linker: Don't rely on out-of-range bv-ref excepti
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 01/02: linker: Don't rely on out-of-range bv-ref exceptions. |
Date: |
Fri, 29 Jun 2018 17:03:06 -0400 (EDT) |
civodul pushed a commit to branch stable-2.2
in repository guile.
commit b87068eee7cfbe8dbc055b11221a931f5e9bec5c
Author: Ludovic Courtès <address@hidden>
Date: Thu Jun 28 17:14:08 2018 +0200
linker: Don't rely on out-of-range bv-ref exceptions.
* module/system/vm/linker.scm (find-shstrndx): Check whether NAME is
lower than the length of BV; remove 'false-if-exception' around
'string-table-ref' call.
---
module/system/vm/linker.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/module/system/vm/linker.scm b/module/system/vm/linker.scm
index 6ad582a..80c3dcf 100644
--- a/module/system/vm/linker.scm
+++ b/module/system/vm/linker.scm
@@ -1,6 +1,6 @@
;;; Guile ELF linker
-;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2012, 2013, 2014, 2018 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -478,8 +478,8 @@ section index."
(bv (linker-object-bv object))
(name (elf-section-name section)))
(and (= (elf-section-type section) SHT_STRTAB)
- (equal? (false-if-exception (string-table-ref bv name))
- ".shstrtab")
+ (< name (bytevector-length bv))
+ (string=? (string-table-ref bv name) ".shstrtab")
(elf-section-index section))))
objects))