Explain why kFuncTag/kClassTag should remain as strings.
Change-Id: Id59466a81ad24fc8b805630de1a90f46ec585ac5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/74833
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/xfa/fxjse.h b/fxjs/xfa/fxjse.h
index 59299a1..2d70576 100644
--- a/fxjs/xfa/fxjse.h
+++ b/fxjs/xfa/fxjse.h
@@ -14,6 +14,8 @@
namespace pdfium {
namespace fxjse {
+// These are strings by design. With ASLR, their addresses should be random, so
+// it should be very unlikely for an object to accidentally have the same tag.
extern const char kFuncTag[];
extern const char kClassTag[];
@@ -59,13 +61,13 @@
};
struct FXJSE_FUNCTION_DESCRIPTOR {
- const char* tag; // pdfium::kFuncTag always.
+ const char* tag; // `pdfium::fxjse::kFuncTag` always.
const char* name;
FXJSE_FuncCallback callbackProc;
};
struct FXJSE_CLASS_DESCRIPTOR {
- const char* tag; // pdfium::kClassTag always.
+ const char* tag; // `pdfium::fxjse::kClassTag` always.
const char* name;
const FXJSE_FUNCTION_DESCRIPTOR* methods;
int32_t methNum;